Hi
I seem to have a problem.
When a user clicks the save button to submit the data on my form to SharePoint, those impatient users, are clicking the save button more than once, and its creating more than 1 item in SharePoint.
I'm sure others have faced the same issue, my thought was to disable the save button unless there is a change made on the form, different to the data source?
If this is a good way, can someone advise how I achieve this, or if someone has a better way of dealing with this, please advise?
Thanks
Solved! Go to Solution.
If that's the case, you could set a Wait variable in the App OnStart then any controls could use it throughout your app
eg
// app OnStart
Set(wait, false);
// submit form
Set(wait, true); SubmitForm(..);
// any controls eg buttons
Button.DisplayMode = If(wait, DisplayMode.Disabled, DisplayMode.Edit);
// onSuccess
Set(wait, false); ... your other code ...
Or similar
I've just recently started using a screen transition, using the Navigate() function, to stop users doing this with Patch & SubmitForm. It can be a little disconcerting for users, depending on the process, but hey it helps the developers out heaps!
Hi @Lefty ,
If you want it enabled once per screen visit, set a Variable at screen OnVisible
UpdateContext({vSave:true})
On the Save button OnSelect
All the save stuff;
UpdateContext({vSave:false})
The DisplayMode of the button
If(
vSave,
DisplayMode.Edit,
DisplayMode.Disabled
)
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.
Like, when a user clicks the save button, the first thing that occurs is navigate to another screen?
If yes, what if the submit fails as my send email code is on the OnSuccess of the form and if its successfully submitted i then navigate the user to a SucessScreen.. not sure how this would then work?
Thanks, definitely an option I could use, i'm just thinking from a user experience, it won't be ideal if they need to refresh the page and then navigate to around Screen6 before they can make a change to the form?
@Lefty ,
That can be catered for too - if you have a refresh button, reset the variable to true in this.
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.
If that's the case, you could set a Wait variable in the App OnStart then any controls could use it throughout your app
eg
// app OnStart
Set(wait, false);
// submit form
Set(wait, true); SubmitForm(..);
// any controls eg buttons
Button.DisplayMode = If(wait, DisplayMode.Disabled, DisplayMode.Edit);
// onSuccess
Set(wait, false); ... your other code ...
Or similar
@Eelman
Thanks this makes sense to me and I've implemented it, cant fully test this as its only in certain scenarios where the save/submit takes more than a few seconds to complete, so until that happens i cant see if this functions they way i want it to , but it should.
👍
This is what I have done App OnStart:
Set(vWait,false);
On the Save buttons OnSelect:
Set(vWait,true);
SubmitForm(Form1);
OnSuccess of the form:
Set(vWait,false);
A thought occurred, if the OnSuccess does not trigger, the button will stay disabled right? have I missed something from your suggestion?
Or maybe I can set the vWait variable to false at OnFailure too?
Yep, that makes sense, I'd cover all bases and reset your vWait variable if the submit failed. Good call!
👍
User | Count |
---|---|
141 | |
97 | |
89 | |
78 | |
56 |
User | Count |
---|---|
191 | |
187 | |
105 | |
99 | |
91 |