Update variable value without creating new variable - possible to use existing variable name?

Hi,
I have a scenario with a Survey123 Connector. It loads in attribute values. We would like to change one of these values for use in the rest of the scenario. For example, replace question 1 values of “original answer” with “updated answer”.

If we use the set variables tool, it creates a new variable, which then has to be referred to in the remainder of the scenario. e.g {{10.feature.attributes.questionone}} retains the “original answer” and a new variable is created {{11.SetVariableToolName}} with the “updated answer” value.

We don’t want a new variable as all the references to this change, and it becomes clunky to implement. Is it possible to just update the 10. variable value instead of creating a new custom one?

We are also working with integer values, not string.

Thanks!

Create a json from the original values and change want do you want there. So you can rebuild the values.

If you need additional support, please don’t hesitate to reach out.

Cheers

1 Like

if you name your variable will it not overwrite it when the new answer comes along? Or do you need to retain the original answer? If it is the latter could you use “set multiple variables” and name them “OrignalAnswer” and “UpdatedAnswer”?

2 Likes

I tried naming the variable by adding it as the name parameter but got an error
"BundleValidationError. Validation required for 1 parameter(s). > Missing value of required parameter ‘name’. Origin Make.

I believe putting in the variable tried to pass the variable value instead of the variable name? The value is likely to be empty, which would explain the error.
Not sure how to enter it correctly. The variable is a field value from a Survey123 Connector.

{{24.feature.attributes.surveyfieldname}}

How do I enter the above as a variable name, not the variable value, into the tool?

Something is definitely not right. This is what the SetVariable module looks like

You simply name the variable and assign it the value. If you areww not seeing this please post screenshot so everyone can get a better idea of what is happening.