cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bhitchlock
Level: Powered On

SharePoint List Form - How to switch to Edit Form for new item after Create?

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

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: SharePoint List Form - How to switch to Edit Form for new item after Create?

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:1.JPG

 

2.JPG

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,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: SharePoint List Form - How to switch to Edit Form for new item after Create?

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:1.JPG

 

2.JPG

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,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bhitchlock
Level: Powered On

Re: SharePoint List Form - How to switch to Edit Form for new item after Create?

Thanks Kris,

This works! I need to test more, but so far so good.

 

Brian 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 389 members 4,697 guests
Please welcome our newest community members: