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
Dual Super User
Dual Super User

@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
Dual Super User
Dual Super User

@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

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,372)