cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Best practises for submitting Canvas App form to SharePoint?

Hi all, 

 

I am creating custom buttons that would allow to submit Canvas app form to SharePoint and would like to ask for advice regarding best practices for doing so.

My objective is:
1. The button changes status (ACCOMPLISHED)
2. The button submit the form (ACCCOMPLISHED)
3. User is notified (FAILED)

After I submit the following OnSelect function, the form just automatically closes. Is there a way to prevent it and the let users see the notification message and close the form themselves?

Current OnSelect function

 

 

/*set status and submit the form*/
Set(
    vStatus,
    "Draft"
);
SubmitForm(MT_Details);
Notify(
    "Draft has been saved",
    NotificationType.Information
);
Refresh('MT Testing');
ResetForm(MT_Details)

 

 


Edit1: I am not sure if it is OKAY to end OnSelect function with Refresh('MT Testing'); ResetForm(MT_Details). I saw somewhere that it is recommended to refresh your SP site and the form after submitting the form, but couldn't confirm if that is truly the best practice. Would appreciate any advice.

1 ACCEPTED SOLUTION

Accepted Solutions
rsaikrishna
Community Champion
Community Champion

@Anonymous 

 

After submitting the form, the form automatically closes. The form has OnSuccess and OnFailure properties. 

 

In the OnSuccess property, you can write your formulas which will be executed after the form is successfully submitted such as Navigating to ViewForm of the form with Form1.LastSubmit.ID property. 

 

You do not need to Refresh the SP list after submitting the form.

 

Please try above and share your questions if you have any.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

View solution in original post

2 REPLIES 2
rsaikrishna
Community Champion
Community Champion

@Anonymous 

 

After submitting the form, the form automatically closes. The form has OnSuccess and OnFailure properties. 

 

In the OnSuccess property, you can write your formulas which will be executed after the form is successfully submitted such as Navigating to ViewForm of the form with Form1.LastSubmit.ID property. 

 

You do not need to Refresh the SP list after submitting the form.

 

Please try above and share your questions if you have any.

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
Anonymous
Not applicable

@rsaikrishna , 

Thank you for the advice! I managed to show the notification without closing the form. However, after the form is submitted, all fields are cleared, the following function is activated:

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@'MT']),SharePointIntegration.Selected)"

Is it possible to preserve the values in the the canvas app form fields after submitting the form?


Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,570)