Setting of a propretie according to value of a set

Hi

Please tell me how to position the value of a property according to the values of a set.

The following lines of an action script run without error

parameter “p1” = “{value of key “_Solution_Application_Type” of json of file (parameter “path”)}”

// here the value of p1 is “Software”

if {Not(parameter “p1” is contained by set of (“Software”; “InHouse”))} then
parameter “p1” = "Not Autorised"
endif

setting “_AWB_Solution_Application_Type” = “{parameter “p1”}” on “{parameter “action issue date” of action}” for client

but when I remove the negation from If, like

if {parameter “p1” is contained by set of (“Software”; “InHouse”)} then

The action also executes without error, but no change is made to the p1 property.
It always retains the intial value “Software”, whereas it should be equal to “Not Autorised”.

Regards

I think it would help if you could show a snippet of your JSON file and explain a little more what you’re attempting.

Note, though, that a parameter can only be set once during the life of the action. A parameter cannot be set, and then change to a different value later.
You might be able to do something like

parameter "p1" = "{value of key "_Solution_Application_Type" of json of file (parameter "path")}"

// here the value of p1 is “Software”

setting "_AWB_Solution_Application_Type" = "{if (parameter "p1") is contained by set of ("Software"; "InHouse") then (parameter "p1") else "Not Authorized" }" on "{parameter "action issue date" of action}" for client

Hi

Thank you very much, it works now.

indeed, a parameter can’t change its value in an action script

Regards

1 Like