Reset choice field to empty on save.

  • 7 November 2017
  • 8 replies
  • 54 views

Badge +1

I am using a choice field to display hidden panels with extended record information. When user saves the record, I do not what that choice value saved. That way when the record is opened again, the panel would remain hidden. I have searched, but couldn't find anything on this.


8 replies

Userlevel 6
Badge +16

Just connect your choice control to a field on your list.

Badge +1

After the user saves with that open, I need it to not save. This is what I need below?

Choice Control:  'Display Additional Tracking Information'

Check box to display panel

Save record

Open record and box is not checked

But when the record is opened up/edited that box is still checked.

Userlevel 5
Badge +8

Like Fernando said above, you can have that choice control connected to a field in your list.  Setup a workflow to run on New Item / Item update to set that field back to no (unchecked). With this configuration, anytime that form is saved that box will be unchecked and the field will be hidden again.

Badge +1

Thank you for the response. The added clarity around using a workflow makes sense (don't know why I didn't think of that sooner). Just assumed there was some way to modify the control in the form. Thanks again!

Badge +1

So, I am still not getting the solution to work. I made a very simple workflow on my list that starts when an item is modified to update the field to value to 'no'.  However, when I open up an item that previously had the box checked, it is still opening checked. What am I missing?

Userlevel 5
Badge +8

Hi Shannon,

I have a workflow with just the Set Field Value, added.  It's configured like below (Show Multiline is a Yes/No column on my list):

210460_pastedImage_1.png

The form is configured with the Check box and a rule on a Multiline text box.

210462_pastedImage_3.png

210461_pastedImage_2.png

My workflow is set to run on New Item and Item modified, and it sets the field appropriately after the item is submitted / modified.

The only thing I can think is that the field on the form might not be connected to the field in the list. Let me know if this helps!

Badge +1

I have the same exact set-up that you outline above.  When I 'save' with the field checked, there are 2 different outcomes occurring with no consistency. 1. Record 'saves', but when I reopen the box is still checked. 2. I get the following error and cannot save.

Userlevel 5
Badge +8

That looks like you're hitting a race condition.  The form may not be fully submitted by the time the workflow is trying to change the item.  You can throw a 1 Minute 'Pause For...' action (which will be a 1 - 5 minute pause depending on when the timer job last ran) as the first action in the workflow and this will likely clear up the issue. 

Aaron Labiosa‌ wrote a solid blog post on Race Conditions Defensive Workflow Design Part 4 - Slow Down and Speed Up.

The other option would be to do this using custom Javascript.  Some combination of the two posts below would likely get you what you are looking for:


Reply