Hi Everyone,
I have a SharePoint list with custom New, Edit and View forms. Upon a successful save I would like to switch to the Edit Form with the new item displayed. How do I set the item of the Edit form to the last submitted item? Or is it possible to update the Selected property of the SharePointIntegration control somehow?
Thanks for any suggestions.
Brian
Thanks Kris,
This works! I need to test more, but so far so good.
Brian
Hi @bhitchlock,
Do you custom a form for your SP list using PowerApps?
Do you want to switch to the Edit form after you created a new item in your SP list?
I have made a test on my side, please take a try with the following workaround:
I created separated forms to create, edit or show the list item in custom form via the following blog:
https://powerapps.microsoft.com/en-us/blog/separate-custom-forms/
On your side, you could consider take a try to custom your three separated forms as a mentioned above.
Set the OnNew property of the SharePointIntegration control to following:
Set(CurrentSubmitted, Blank()); /* <-- Reset CurrentSubmitted variable */
Set(SharePointFormMode, "CreateForm");
NewForm(CreateItemForm);
Navigate(CreateScreen, ScreenTransition.None)
Set the OnEdit property of the SharePointIntegration control to following:
Set(CurrentSubmitted, Blank()); /* <-- Reset CurrentSubmitted variable */
Set(SharePointFormMode, "EditForm");
EditForm(EditItemForm);
Navigate(EditScreen, ScreenTransition.None)
Set the OnSave property of the SharePointIntegration control to following:
If(SharePointFormMode="CreateForm", SubmitForm(CreateItemForm), If(SharePointFormMode="EditForm", SubmitForm(EditItemForm)))
Set the OnSuccess property of the CreateItemForm (New Form) to following:
Set(CurrentSubmitted, CreateItemForm.LastSubmit);
ResetForm(CreateItemForm);
EditForm(EditItemForm);
Set(SharePointFormMode, "EditForm");
Navigate(EditScreen,ScreenTransition.None)
On your side, you should type:
Set(CurrentSubmitted, YourNewForm.LastSubmit); ResetForm(YourNewForm); EditForm(YourEditForm);
Set(SharePointFormMode, "EditForm")
Navigate(EditScreen,ScreenTransition.None)
Set the Item property of the EditItemForm (Edit Form) within your Edit screen to following:
If( IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), First('20190211_case5'), If(!IsBlank(CurrentSubmitted), CurrentSubmitted, SharePointIntegration.Selected) )
On your side, you should type:
If( IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected), First('YourSPList'), If(!IsBlank(CurrentSubmitted), CurrentSubmitted, SharePointIntegration.Selected) )
Please check the attached GIF screenshot for more details:
Best regards,
WarrenBelz
146,587
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,928
Most Valuable Professional