Conditional rendering for field A based on value of field B

  • 2
  • Idea
  • Updated 4 years ago
  • Implemented
Is it possible to create a conditional rendering condition in a field editor (or elsewhere) that evaluates the value in field A against a value of field B?  I tried single/multiple specified values but this doesn't appear to apply merge syntax.  I thought I remembered there being a "field in same row" option at one point?

Thanks!
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb

Posted 4 years ago

  • 2
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Barry,
I'm not sure if I understand your question. Do you mind giving an example?
Thanks!
Emily
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hi Emily -

Happy to do so.

When setting rendering conditions for a field in a field editor, what I'm trying to do is write a condition that evaluates the value in Field A against the value in Field B.  

For example, let's say we have two fields in our Model - MyField__c and MyOtherField__c.  I'd like to write a condition on MyOtherField__c to display only if the value in MyOtherField__c is not equal to the value in MyField__c.

It would be very similar to using a Source Type of "Model Field Value", choosing the appropriate Model, selecting field "MyOtherField__c" and then "single specified value" although in this case, the single specified value would actually come from another field instead of written in to the textbox.  Essentially, if there was a drop-down for "Content" that said "another field in same row" or if the textbox applied a merge prior to evaluation (merge would get tricky because it would need a way to escape special characters).  

I thought I remembered a while back there was something like "Another Field in Same Row" but that was likely before the new Source Types were introduced or its very possible I'm not remembering correctly :)

Hope this helps better explain what I'm after.  Let me know if you can think of a way to do this.  I'm hoping I'm just overlooking something that is staring me in the face saying "click here silly, click here."

Thanks!
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,004 Points 20k badge 2x thumb
Barry, it's astonishing how certain requests seem to get asked for by everyone all at the same time --- we've gotten somewhere between 5-10 requests for this capability of Conditional Rendering from different customers within the past 2 weeks.

We're working on it --- hope to have it available in the forthcoming "Superbank" release.
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Awesome news Zach, thanks!

Btw, I found the "another field in row" I was thinking about, it's on filter conditions 
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,076 Points 10k badge 2x thumb
Hey Zach - I believe this can be marked as "added/resolved" unless there is more coming along these lines?
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Thanks Barry.