web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Customised SharePoint form hangs intermittently on submission

(0) ShareShare
ReportReport
Posted on by 91

One of our document libraries has a SharePoint form customised with PowerApps. One of our users regularly has trouble when submitting the form. The form hangs and no submission is registered. When they try again with the same data, the submission often goes through.

 

They have tried using a different browser but the same problem crops up.

MicrosoftTeams-image (1).png

 

The OnSave property of the SharePointIntegration control has been altered, to work around the fact that the standard implementation does not support creating new items in a document library. Therefore, when the form is launched for item creation, OnSave launches a Power Automate flow to manually create the item.

 

The run history of the Power Automate flow shows that when the form hangs on submission, the flow never starts. When the form is submitted successfully, the flow does start and run. This implies that the problem is client-side - maybe even browser-based.

 

What can be done to diagnose and solve the problem?

 

A simplified version of the OnSave property is below.

 

If(
 frmSharePoint.Mode = frmSharePoint.Mode.New,
 //when making a new item, create the item through a flow
 If(
 frmSharePoint.Valid,
 Notify("Created ID is " & CreateRecord.Run().id);
 RequestHide(),
 //if form is not valid, notify the user 
 Notify(
 "Please ensure all mandatory fields are complete before saving.",
 NotificationType.Error
 )
 ),
 //when editing an item, submit the SharePoint form contents
 SubmitForm(frmSharePoint);
 RequestHide()
);

 

 

I have the same question (0)
  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at
    Re: Customised SharePoint form hangs intermittently on submission

    What if you try:

    If(
    frmSharePoint.Mode = frmSharePoint.Mode.New,
    //when making a new item, create the item through a flow
    If(
    frmSharePoint.Valid,
    Set(varFlowResponse, CreateRecord.Run().id);
    Notify("Created ID is " & varFlowResponse);RequestHide(),
    //if form is not valid, notify the user
    Notify(
    "Please ensure all mandatory fields are complete before saving.",
    NotificationType.Error
    )
    ),
    //when editing an item, submit the SharePoint form contents
    SubmitForm(frmSharePoint);
    RequestHide()
    );

  • Spinner Profile Picture
    91 on at
    Re: Customised SharePoint form hangs intermittently on submission

    Thanks for the reply @Alex_10. I haven't yet had a chance to test it. However the user's just informed me that the form sometimes freezes even when editing the item - i.e. when the active branch of the main If() statement leads to SubmitForm() rather than CreateRecord(). So I don't see how it can be anything to do with the Power Automate flow.

     

    Any ideas how to diagnose the cause of the freezing - browser logs, etc?

  • Spinner Profile Picture
    91 on at
    Re: Customised SharePoint form hangs intermittently on submission

    @Alex_10Tried this modification - for some reason it causes the CreateRecord() call to instantly return with a blank id value, with no flow actually starting, and the form to be hidden immediately. The notification isn't shown until the next time the form is open.

     

    Think this might be a red herring, as the hangs sometimes happen when SubmitForm() is called rather than CreateRecord().

  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at
    Re: Customised SharePoint form hangs intermittently on submission

    i think the problem might be here: frmSharePoint.Mode = frmSharePoint.Mode.New

    what if you try:

    SharePointIntegration.OnNew = Set(varMode, "New");

    SharePointIntegration.OnEdit = Set(varMode, "Edit");

     

    If(
    varMode = "New" && frmSharePoint.Valid,
    Set(varFlowResponse, CreateRecord.Run().id);
    Notify("Created ID is " & varFlowResponse);
    RequestHide()
    ,
    varMode = "New",
    //if form is not valid, notify the user
    Notify("Please ensure all mandatory fields are complete before saving.", NotificationType.Error)
    ,
    varMode = "Edit",
    //when editing an item, submit the SharePoint form contents
    SubmitForm(frmSharePoint);
    RequestHide()
    );

  • Spinner Profile Picture
    91 on at
    Re: Customised SharePoint form hangs intermittently on submission

    Thanks for the reply, @Alex_10.

     

    I've checked that the value of frmSharePoint.Mode is, as far as I can tell, consistently 1 (i.e. New) when creating a new item, and 0 (i.e. Edit) when editing an item. Since that is the case, I can't see how setting another variable in OnNew and OnEdit would affect the If branching. (As a matter of fact, I initially used a variable similar to the varMode you describe, but simplified it in favour of using the form's mode directly.)

     

    Furthermore, since I've had problems in the past with variables not being reset on re-opening the form, it could potentially open up problems.

     

    Could you please explain your thinking as to why this might work?

     

    I also don't see how it could have any bearing on the form freezing or not (no "marching ants", just a blank screen).

  • Spinner Profile Picture
    91 on at
    Re: Customised SharePoint form hangs intermittently on submission

    Still having issues with this. Any advice on how to debug this?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 714 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 419 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard