Attempting to build a table that generates on the fly calculations based on a picklist value selection

  • 1
  • Question
  • Updated 1 year ago
  • Answered
Hello Skuid Community!

I am currently trying to build a table that will show a single row of six columns where 4 of the columns are calculated based on the first 2. One will be a drop down where a percentage is selected and then the values are calculated. Please see the image below for the mock-up. 


Thus far I have the first two fields from the model and then I have built UI-Only fields to create the calculations but I have been unsuccessful in making the table generate the calculations in real time. 

Any direction in accomplishing this would be very helpful!

Thanks all. 
Photo of Michael Schniepp

Michael Schniepp

  • 1,808 Points 1k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
So you want the UI only formulas to update when you change the target retention %? Is Targer Retention % a Ui only field or a database field? My guess is that you would need to save the changes to the model to get the UI only to update based on changes to database fields. You could do this with a model action that saves the model each time you update the target retention % field.
Photo of Michael Schniepp

Michael Schniepp

  • 1,808 Points 1k badge 2x thumb
Hi There Skuidward, The Target Retention % field is currently an UI-only field but it seems a table made with an aggregate model can only be Read Only. Do you think in order for this to work, I will need to make a database field that will store the variable %  which upon editing and saving would update the aggregate model table?
(Edited)
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Ok... this is a tricky one...
So you need the first two fields from the agg model, but you need to be able to update fields on the object.
You could try making a regular model on the object in addition to the agg model. Then you could use the model lookup function of UI only formula fields to pull in the two agg model fields Into the regular model. You could have a UI only formula to display the original renewal book and the book won fields, then additional UI only formula fields to do the math based on those fields.
Photo of Michael Schniepp

Michael Schniepp

  • 1,808 Points 1k badge 2x thumb
Hey this worked out perfectly! I simply had an agg model to get the two initial values I needed and then created a separate model which pulled in those two aggregate values along with a few UI-Only fields to produce the calculations and threw those in a table and...voilà! We have our table making on-the-fly calculations! Thanks for the help. 
Photo of Skuidward Tentacles (Raymond)

Skuidward Tentacles (Raymond), Champion

  • 17,224 Points 10k badge 2x thumb
Great!