Script Expression for dynamic Field Values

Post Reply
Tenzo
Member
Posts: 24
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Script Expression for dynamic Field Values

Post by Tenzo »

Hey all,

I have a Submit point that uses lots of conditional Drop downs (If parent equals).

I understand this will show the child field/s when meeting the condition, but I am wondering instead of only the child field being dynamic, can I use a script expression to change the child field Value based on the parent value?

I am not sure what syntax to use to get the values of the parent field when selecting the option "Define Script Expression".
I am just looking to make a (switch - case) to determine the child value/s based on the parent field Value.

Is this possible?
User avatar
tdeschampsBluewest
Member
Posts: 135
Joined: Tue Jun 01, 2021 11:57 am

Re: Script Expression for dynamic Field Values

Post by tdeschampsBluewest »

The Switch client does not support referencing other field values when defining the value of field. This means you can't dynamically set a field's value based on the value of another one

One workaround is to manually create multiple child fields for each possible case and assign them the same tag. This can be used to simulate conditional logic based on the parent value.

However, this approach comes with significant limitations:
  • Requires creating one child per case (e.g. one per parent value)
  • Becomes difficult to maintain as the number of cases grows
  • Can be error-prone when accessing values within XML
Feature Request

There is an open feature request to address this limitation. You can upvote or comment on it to help prioritize its development.

Visit: https://my2.enfocus.com/en/switch/featurerequests
Search for: Allow Switch client variable to calculate/reuse values from parents
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Tenzo
Member
Posts: 24
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Re: Script Expression for dynamic Field Values

Post by Tenzo »

tdeschampsBluewest wrote: Wed Jul 09, 2025 6:12 pm The Switch client does not support referencing other field values when defining the value of field. This means you can't dynamically set a field's value based on the value of another one

One workaround is to manually create multiple child fields for each possible case and assign them the same tag. This can be used to simulate conditional logic based on the parent value.

However, this approach comes with significant limitations:
  • Requires creating one child per case (e.g. one per parent value)
  • Becomes difficult to maintain as the number of cases grows
  • Can be error-prone when accessing values within XML
Feature Request

There is an open feature request to address this limitation. You can upvote or comment on it to help prioritize its development.

Visit: https://my2.enfocus.com/en/switch/featurerequests
Search for: Allow Switch client variable to calculate/reuse values from parents
Not surprising that it isn't an option given the already know limited Submit Portal options.
Thanks for confirming this for me. I added upvoted it, added a comment, and marked it as critical. Hopefully they will start working on a better Submit portal for future releases. Thanks again!
Post Reply