Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ConfiForms: Show text dependent on field value in table view (using if-condition ?)

Christian Sieber August 9, 2022

I've a form collecting information about hardware ownership in our company.

There is one user-field in the form having fieldname owner.

By the third symbol of the owner's username I can derive the employee relationship (employee or contractor).

How do I add a column in table view labeled "employee relationship" that shows "contractor" in case of the username has a "9" as third symbol. In all other cases the column should show "employee".

I've tried to achive this using a if-condition in the form field macro. This didn't work, the column was not displayed at all.
confiforms-field-macro.PNG

Field name value:

IF([entry.owner.id.trimLeft(2).trunc(1)]==9,"contractor","employee")

Thanks for your help
Christian

1 answer

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 9, 2022

Hi

You cannot use the formulas directly in the field name, but you can do it through the virtual function. And evaluateFormula  function should be able to help

Set the field name to something like

id.evaluateFormula(IF([entry.owner.id.trimLeft(2).trunc(1)]==9,"contractor","employee"))

 Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events