I have a gallery that populates a form when an item is selected. This form can be edited. When the form fields are edited and submitted the gallery updates but the form doesn't. Tt shows the old values until I select on the item again in the gallery. How do I get the form to update on submit?
Funny you mentioned this. I was thinking I should set a variable for the gallery item and then use that for my form's item property. Let me give this a try.
One thing. Wouldn't it be better to use this on the On Success property of the form?
Set(gblvar_SelectedRecord, FormName.LastSubmit)
NOTE: I think I had tried Refresh but it gave me an error. I'll try again.
Hi @futr_vision , When you select the item in gallery, have this code:
Set(gblvar_SelectedRecord, ThisItem)
The Items property of form will be gblvar_SelectedRecord and the data source form will remain same as you already have.
On submit button, have this code:
SubmitForm(FormName);
Refresh(DataSource);
Set(gblvar_SelectedRecord, FormName.LastSubmit)
-----------------------------------------------------------------------------------------------------------------------------
I hope this helps.
Please click Accept as solution ✅ if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs up.👍
Thanks,
ANB
Hi @futr_vision ,
If you need the form to be visible at the time the data is submitted (versus leaving the form and coming back to it), you might try placing a datasource refresh or a ResetForm option in the OnSuccess property of the form
Refresh datasource:
Refresh(datasource)
ResetForm option:
ResetForm(formName)
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional