I have a variable that I am using in multiple forms. I am attempting to change the variable depending on which form it is in. I have tried default values and I have functions in the advanced tab. The value of the variable stays the same value that was in the previous form.
Question
Question
Unable to change the value of a variable from one form to the next
Answer
Generally the values are changed manually by a user filling out a form. When you tried using functions to change the value, did you change any of the inputs on the second form? When Form2 is loaded, it will load with the value brought in from Form1, but if there is a formula configured and one of the inputs is changed, the value should update based on the formula.
You could also try a lookup against a database table where you use other fields to determine which form you are on and fill this Var1 with Insert or Update based on those. The lookups should run during form fill and update the value.
Replies
Can you be more specific as to what you are trying to do? A variable is just an ID that can hold a value across forms. If you have VARIABLE1 on your first form and on your second, a value entered into VARIABLE1 will populate that field on the second form. If you change the value in form 2, it will be updated again. If you want to modify the value from form 1 to form 2, I would do that using different variables.
Have VARIABLE1 on form 1, then have a new field on form 2 and use a formula =VARIABLE1 + 5 or whatever.
Thank you. These variables will be read only for the submitted. Var1 on Form1 is set to "Insert" by a function. Var1 on Form2 needs to be set to "Update". However Var1 value on Form2 stays "Insert".
I am calling a workflow that inserts/updates a SQL DB. Therefore, I am passing Var1 to direct the path in the workflow.
If form 1 always needs an Insert and form 2 always needs an Update, why do you pass the same Var1 to workflow? Pass Var1 = Insert after form 1 and pass Var2 = Update after form 2. Or just hard code them in WF, why do you need to pass them from a read-only form field?
This is just an example to explain what I want to accomplish. How do you change the value of a variable from form to form? Is it possible? I use the same variable in the workflow. I would have to add too many decisions points in the workflow if I used multiple variables. I have a condition in the workflow that evaluates Var1. If "Insert" - Insert Data. If "Update", Update Data.
Generally the values are changed manually by a user filling out a form. When you tried using functions to change the value, did you change any of the inputs on the second form? When Form2 is loaded, it will load with the value brought in from Form1, but if there is a formula configured and one of the inputs is changed, the value should update based on the formula.
You could also try a lookup against a database table where you use other fields to determine which form you are on and fill this Var1 with Insert or Update based on those. The lookups should run during form fill and update the value.
Good idea. Thanks. I will use a lookup table.