You are viewing limited content. For full access, please sign in.

Question

Question

Forms 10.2.0 - hiding fields creates a blank variable value (unless shown)

asked on July 27, 2017 Show version history

I have a customer that is running 10.2.0 and somehow in that specific version he is able to clear variables values by having the field hidden with a field rule. As long as the field is hidden, the value of the field is not transferred to the variable of the field. If trying to do this in 10.2.1 that will not work, the variable value will come across no matter if the field is hidden or not.

He wanted this functionality though, since he wants to save the value of only the shown field variable to the repository template. So he crams all the variables into one field. 

However there is one glitch in his system. If one of the hidden fields is shown, then hidden again, the variable becomes populated, even though it is hidden.

I am not able to understand what is happening under the hood here. I know that if I upgrade his system it will break everything since all his hidden values will come into the template, but I don't understand why fields that were previously shown suddenly have a variable value even when they are hidden afterwards.

0 0

Answer

SELECTED ANSWER
replied on July 27, 2017 Show version history

I just tested it and confirmed that in 10.2.1 if it is set to "Ignore the data" it does not pass the data to the next form.

It will keep the value in the field within the same form/task when the field is shown/hidden, but once that task is finished the variable is not populated if the field was hidden when the form was submitted.

The only time the variable is actually saved to the overall process is if "Save the data" is selected. If you upgrade him and set those fields to "Ignore the data" it will work as expected, you just have to watch out for required fields and backend validation.

To test this, I set a rule that hid the target field when another field had a value. I entered a value in the target field first, then entered a value in the "control" field to hide the target field.

  • With "Ignore" set, if the field was hidden when I hit "Submit" the value was not populated in the next step
  • With "Save" set, it maintained the value even if it was hidden
1 0

Replies

replied on July 27, 2017

What setting are you using on the Field Rule when testing? (Ignore the data when the filed is hidden, or save the data when the field is hidden)

1 0
replied on July 27, 2017

He is just using Ignore the data. I read up on that selection though and it is for a different purpose. Something to do with validation of the data, not if the data is present in the variables. We are trying to figure out what causes a variable to be blank for a hidden field that has a value.

0 0
SELECTED ANSWER
replied on July 27, 2017 Show version history

I just tested it and confirmed that in 10.2.1 if it is set to "Ignore the data" it does not pass the data to the next form.

It will keep the value in the field within the same form/task when the field is shown/hidden, but once that task is finished the variable is not populated if the field was hidden when the form was submitted.

The only time the variable is actually saved to the overall process is if "Save the data" is selected. If you upgrade him and set those fields to "Ignore the data" it will work as expected, you just have to watch out for required fields and backend validation.

To test this, I set a rule that hid the target field when another field had a value. I entered a value in the target field first, then entered a value in the "control" field to hide the target field.

  • With "Ignore" set, if the field was hidden when I hit "Submit" the value was not populated in the next step
  • With "Save" set, it maintained the value even if it was hidden
1 0
replied on July 27, 2017

Ok, I finally figured out what threw me off. Because it is working for me now in 10.2.1 but this morning it appeared not to be.

First I created a test form with a drop down and a default value, then submitted it and verified the variable came through. Then I added the field rule to hide it and submitted a new submission. 

When I moved back over to the monitor tab, it had not updated, yet when I viewed the history of the latest submission, it appeared to be my latest submission because the field was hidden and my new text field was visible. But of course the variable for the drop down was populated.

It was actually my first test that I was looking at. It seems the images in the history take into account changes made on the form at a future state, I always thought they were an exact image of the form the way it appeared when submitted.

Back to the subject at hand though, this is exactly the functionality he is looking for. So looks like an upgrade is the solution. Thanks for testing it out!

0 0
replied on August 13, 2017

The help information isn't complete for this functionality. According to the documentation, the Ignore vs Save  checkboxes either ignore the fields/sections for purposes of validation or include them when validating. It doesn't say anything about the data being removed from the fields when they're sent to the next step in the process. I don't always want the data to go away when I choose Ignore because I may be sending a form back to a previous step in the process (maybe to ask the user to enter more info) and need to retain the existing data. I guess I have to go back to using javascript for that. Too bad!

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.