Skip to main content
Open

Multiple values for choice selection

Related products:FME Form

hkingsbury
Celebrity

Often processes will need to go through a Dev/Test/Prod workflow where referenced resources/data/urls change depending on the environment.


When only one reference needs to be changed, it is straight forward to setup a Choice Parameter that allows the environment to be changed


What would be great is if there could be multiple values stored against each choice.

these can be referenced in a similar way to either lists or JSON objects

If Test is selected, then

$(PARAMETER[0]) = testapi.com

$(PARAMETER[1]) = test.sde


or

$(PARAMETER["api"]) = testapi.com

$(PARAMETER["sde"]) = test.sde

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+51
  • Author
  • Celebrity
  • January 19, 2022

Forgot to add - yes you can currently achieve this in a couple of ways

  1. Have conditional statements in all places (eg HTTPCaller) where the parameter value is required
  • This would be a pain if the values changed or an additional environment was added (Pre-Prod)
  1. Have an AttributeCreator at the beginning of the workflow with conditional logic to set an attribute to the correct value
  • Not all workflows are suited to pass an attribute all the way through. could resolve this with a variable setter but would then need to place a variable retriever before using the value

todd_davis
Supporter
Forum|alt.badge.img+20
  • Supporter
  • January 19, 2022

And of course there is the third option, which we discussed, but again has additional steps that mean it is not well known. This uses other parameters to break down the initial parameter.

 

In that case, say you have "devapi.com|dev.sde" as the value in the parameter. You could create two other "private" parameters and give there value as something like @ReplaceRegularExpression($(PARAMETER),"\\|.*","") for Parameter_2 to return devapi.com, and @ReplaceRegularExpression($(PARAMETER)".*\\|","") for Parameter_3 to return dev.sde.

 

It works but not ideal.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings