Blank out input if button choice changes (show_if)

I have a question that I am not sure can be solved. We have setup the app as a survey where there are a number of show_if conditions if you answer a question a certain way. eg.

  1. Is there a business in this property? Y/N
  2. What is the name of the business (show_if question 1 = Yes)

This is the correct logic however the following can occur:

  1. The first question is Yes
  2. Question about business name appears. The user fills in the business name

*3 HOWEVER, they figure they have made a mistake and and put the first question back to No.
4. The business name question disappears as it should, however the name they filled in will still be saved in the table.

Needless to say there is a risk with regards to data quality. Is there any structural way to handle this or do I need to create an action for each show_if in my survey

Thanks in advance.

0 8 316
8 REPLIES 8

Steve
Platinum 4
Platinum 4

Iโ€™m not familiar with any built-in way to erase the value of a dependent column thatโ€™s already been edited by the user. Once the userโ€™s modified the value, the automatic expressions (i.e., initial value) no longer have any effect, so cannot blank the value.

I have the same issue. Iโ€™m still trying to figure out if there is a work around to clear the dependent data. In my mind, that data shouldnโ€™t be saved yet if they are still on the same data entry record.

@Steve

I did the following and it appears to clear the dependent dropdowns if the user selects IS_GEO=FALSE.

  1. created an action to clear the GEO_NO and COUNTRY_GEO_NO which should NOT have a value if IS_GEO=FALSE

  1. created a behavior to run that action when records are added or updated, if IS_GEO=FALSE

  2. for testing purposes I added a confirmation dialog to see if it was actually being called. This dialog appears immediately after I click the SAVE button

  3. IS_GEOโ€™s initial value is FALSE which hides the Region and Country dependent drop downs
    2X_e_ee55714836c336b9ae5ef175cfb11f4e1f70f2d2.png

  4. When IS_GEO is set to TRUE, the dependent drop downs appear and I selected values in each combo box
    2X_d_da6ed1302e4d967e51436aef6791ed1f40c610fe.png

  5. Filled our rest of form but changed IS_GEO to FALSE BEFORE saving. That is when the behavior ran and presented the dialog box.

I clicked yes and the record was saved.

Then I clicked on the sync button and the record was synced.

I switched to the data source and you actually see that the data for GEO_NO and COUNTRY_GEO_NO was saved then erased from the data source.

This may not be an efficient way of doing it but appears to work.

Steve, do you see any problems with this method?

Hi Lucinda,

Thanks for contributing. Similar to your solution, I had also created actions however it would be a huge task for me to create enough actions to deal with all my needs.

Alternatively I may try adding a logical IF statement in one single action similar to what you did, but iterating through the selections on my form to blank input based on the end state of the form on save. In my case this may be the only way. Not sure what the performance issues may be.

@Lucinda_Mason, well done! Now I would challenge you to figure out how to accomplish this with a form on-save action, rather than with a workflow.

@Steve

I think I was already doing that. The form save event was my action. I disabled the workflow and it still worked.

Does the workflow need to be placed somewhere to be called or does it run simply by existing? It seems like it isnโ€™t needed or is it?

Yes, there is SO MUCH I havenโ€™t learned.

If the action is attached to the formโ€™s on-save event, there should be no need for the workflow.

Great. Thanks for being a great teacher

Top Labels in this Space