
Hi all - I hope I can explain this well and thanks in advance for any help I get 🙂
I have a powers app form connected to a sharepoint list. This app has 17 screens and 11 forms in it (form1, form2, form3, etc). Initially I tried to submit all the forms, and I realized that would make 11 different SP list items. NOT what I want obviously.
So, I learned all about patching, and how if you use the Defaults command it will create a new item and patch everything together. and if you do not use default, it will update the existing item - Perfect!
Then I needed to setup a few scenarios, like save and continue, save and exit, submit when completed. As you can imagine, this is a long, time consuming form, so people will certainly want to save and continue, or save and come back to it later. I have figured out ways to set up every scenario EXCEPT one where they are filling the form for the first time, and they want to just save and stay within the form and continue. Here's where I am at:
I have created a "save and continue" button that has this formula for onselect:
Patch('Account Planning',Defaults('LISTNAME'),Form1.Updates,Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates,Form6.Updates,Form7.Updates,Form8.Updates,Form9.Updates,Form10.Updates,Form11.Updates);Set(varnotnew,1);Back()
and the display mode code is:
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),DisplayMode.Edit,Disabled)
So, technically once they hit this button, it should create the item with what they have filled in so far and then disable as the form is no longer blank or empty. I need that because if they click this button again, it creates a new item because it uses the Defaults command. My solution was going to be that another "save and continue" button appears with this onselect code which updates the item:
Patch(LISTNAME,SharePointIntegration.Selected,Form1.Updates,Form2.Updates,Form3.Updates,Form4.Updates,Form5.Updates,Form6.Updates,Form7.Updates,Form8.Updates,Form9.Updates,Form10.Updates,Form11.Updates);Back()
and this displaymode:
If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),DisplayMode.Disabled,Edit)
So button one is enabled when the form is new, and disabled once there is content. Button 2 is disabled when the form is new and is enabled once there is content. Perfect - exactly what I want.
But it doesn't work......well, I should rephrase - it does all work if I click the button, exit out of the form, refresh the web page, and then go back in. The first button is then disabled and the second appears - perfect. But it doesn't work if you click the first button, continue filling in the form, and go to save again.....button 1 is still enabled and the second is not. 😞 the key in all of this is that you need to refresh the whole page in order for the sharepoint item to understand......not ideal
any suggestions?