Render condition value using merge field

  • 9
  • Idea
  • Updated 3 years ago
  • Under Consideration
Desire to use a model field as the conditional value. Is this possible?

Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb

Posted 4 years ago

  • 9
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
That should be fine. 
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Seems to only process hard-coded values e.g. 0.0, 123.34, etc.
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb
Are you in the right context? try with 

{{$Model.ModelName.data.0.FieldName}}
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Our condition value fields do not current process merge templates  (except in the case of Reference field filter conditions).   So.. no.. this would not work. 

Sorry. 

It is a cool idea though. 
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Peter - you should be able to do rendering conditions based on specific number of rows in a model. 

Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb
Yup, but I need to be able to render if the number of attendance records for today (count of records in a child model) < the number of enrolled students (a value in a field on a parent record). Would love to hear an alternative solution, though.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Ok,  this solution is ugly.  Add two more fields to your parent object.  One is rollup summary of current days attendance records and Two is formula evaluating Current Day's Attendance against Total Enrolled studants.  I think this can be a boolean field. 

Then do your conditional rendering based on Field Two. 
Photo of Peter Bender

Peter Bender, Champion

  • 6,246 Points 5k badge 2x thumb
Unfortunately, you cannot do rollups in Salesforce based on dynamic criteria, such as "TODAY()", so I can't get the number of child records for current date. That's actually why I was hoping Skuid could do that because I also need my page to be more flexible then that, able to navigate to any date and see whether there might be missing child records for that date.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
I think you'll need to go to Javascript.  You know... The dark side... 

You can use filters to limit attendance data to one day.  Then you have  model.length.  You can compare that to the total enrollment number from another model.  Use that comparison to present an appropriate message,  render a component, etc. 
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Pablo,

Thanks for the comment and suggestion. Pretty sure that I am in the right context.

My use case is that I have a Row Action that shows a Pop which contains a Tab set. It is within one tab where I have defined rendering conditions.

Regards,
Irvin
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Hi Irwin, 

I ran into the same issue in a similar scenario. The situation however allowed me to compare the current row to a URL parameter I set, which is an option even for Render Conditions. It might not help in your case, but thought I'd mention it here since this is could be relevant for another project.

Regards, 

Robin
Photo of Irvin Waldman

Irvin Waldman, Champion

  • 9,006 Points 5k badge 2x thumb
Thanks for the suggestion. 
Photo of Jack Sanford

Jack Sanford, Champion

  • 8,322 Points 5k badge 2x thumb
Can we make this an Idea instead of a Question?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Yes we can make this an Idea.  Vote it up... 
Photo of Robin

Robin

  • 894 Points 500 badge 2x thumb
Would be fantastic to have this feature available in a future release. Is this currently under development? Thank you, Rob!