You are viewing limited content. For full access, please sign in.

Question

Question

Calculation to set text field value to another drop down field selection

asked on January 3, 2020

Background:

I'm using Forms Essentials, so I don't have the option to do database lookup. I currently have a drop down field for "Department" and a single line text field for "Division". In order to add new (requested) functionality to this existing form, I need to set a process flow condition dependent on Division for our Public Works Department only. I added a new drop down field, Division_PW. I have a field rule to hide the Division text field and show the Division_PW field when Department = Public Works.

Question:

Instead of keeping a separate division field for Public Works throughout the entire process flow, I'd like to set the Division text field to the value of the Division_PW drop down selection only when Department = Public Works. Is this possible through field calculation on the Division field, or do I have to resort to JavaScript?

0 0

Answer

SELECTED ANSWER
replied on January 3, 2020 Show version history

The problem you might encounter is that if you set a calculation, it can override a value entered by the user.

For example, you can do something like

=IF(Department="Public Works",Division_PW,"Other")

If department is "Public Works" then it sets the field equal to the Division_PW dropdown, however, the problem comes in the "else" condition.

If the "else" is meant to be direct user input, then that value will be overwritten by any change that triggers the calculation to update the value.

If you're setting the "else" value equal to a separate user input, then you're fine, but there's not really a way to use calculations to alternate between automated values and direct user input.

 

To accomplish your goal of once consolidated field, you could use JavaScript, or you could create a "Helper" field, by which I mean you have one "Division input" field that takes user input, and separate "Division" field with the calculation which you actually use in your process flow.

Then, your calculation for Division would be something like

=IF(Department="Public Works",Division_PW,Division_Input)

You just make the "real" division field with this calculation hidden and read only, and that is the value you carry forward through the process.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.