I’ve submitted this as a bug report but wanted to warn others about it in case your users might be set up to lose important data as well as to get help with another workaround since this one seems to be the suggested one here in the forums and doesn’t work with the update action.
I have a screen that I’m using to update records in a collection. I have an update action tied to a button, followed by a “change input value” to clear the fields so that the next record doesn’t open with the previous record’s data in the next record’s empty fields.
As expected, the fields are cleared when I click the button but, if I haven’t clicked in all of the fields that contain text, the “change input value” instruction seems to get inserted into the record, overwriting the information that was already there, as though the “change input value” action were happening before the update action.
- Create a screen with a few input fields that has a record passed into it from another screen
- Create a button
- Add an update action to it, using the inputs to update the record’s fields
- Add a “change input value” action and set it to clear the input (after the update action)
- Preview and note that:
→ when you first arrive on the screen, the inputs will be populated with the data and that, if you click in all of the inputs and click the update button, they will act as expected
→ if you arrive on the screen with the inputs populated as they should be, any fields you don’t click into will be replaced and be empty after you hit the update button, as though the update function were now running after the “change input value” action.
So, if you have a contact card, for instance, click on it to update the telephone number, change only the telephone number and click the created ‘update’ button, the telephone number will remain, but all other contact fields that weren’t clicked on will be emptied!
Does anyone have any other suggestions for clearing fields so that data from the last-viewed record isn’t appearing in empty fields the next time the screen is loaded?