Can I use #EVAL[] in a Record Name template to dynamically s

Posted by Rollbase User on 17-Oct-2012 10:20

Imagine I have a Team object with team_number and team_nickname fields. The team_number will always be set, but the nickname may not. Can I use #EVAL[] in a Record Name template to set the name to "team_nickname" if it exists, or "Team #{!team_number}" if it does not?

All Replies

Posted by Admin on 17-Oct-2012 10:35

Update - I found the page (162) in Rollbase in Action that gives an example using #EVAL for a checkbox and the shortcut ( expr ? true : false) using static strings:



#EVAL[ {!club_member} ? "Member" : "Non-Member" ] {!title}



I will try it out with a longer expression and template values instead of strings and report back to possibly answer my own question.

Posted by Admin on 17-Oct-2012 10:43

Yes, you can use #EVAL[] in a Record Name template.

Posted by Admin on 17-Oct-2012 11:09

I figured out a solution after several tries and some extra quotes.



#EVAL["{!team_nickname}" == "" ? "{!team_number}" : "{!team_nickname}"]



@Pavel -- A "debug" feature would be helpful here. I tried several expressions that just created an "ERROR" link, but then noticed I had an extra space between ("#EVAL [") which was the root problem.

Posted by Admin on 17-Oct-2012 11:18

I agree, I should add "Preview" link.

This thread is closed