Perform math in a template

  • 1
  • Question
  • Updated 3 years ago
  • Answered
So I have created models with conditions to filter out records based on values in certain fields. Then I use something like: {{$Model.MODELA.data.length}} to display a count of the records in a template. I would like to add this count to the count of another model. So in non-programming terms it would look something like this:
{{$Model.MODELA.data.length}} + {{$Model.MODELB.data.length}}
Is it possible to add these two results together in a template?
Thanks!
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
That is not possible in a template.  Sorry. 
Today - you'll have to write a short javascript snippet to do that calculation.  See this tutorial:  http://help.skuidify.com/m/supercharge-your-ui/l/153540-highlighting-critical-data-using-templates-a...

In our next release we will be providing more options for simple calculations in client side fields.  Stay tuned for release news... 
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
I've been tuned in foreeeeeever!

Client side fields!!!! Me likey. Cmon cmon cmon!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Really can't wait for this... Client side fields will be totally awesome for the reports we're developing right now.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Oh yes! 
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Is it part of this: "tons of updates and features in Skuid Banzai."