SOLVED

How do I stop SharePoint customized canvas app newform.aspx from loading first record?

%3CLINGO-SUB%20id%3D%22lingo-sub-2778266%22%20slang%3D%22en-US%22%3EHow%20do%20I%20stop%20SharePoint%20customized%20canvas%20app%20newform.aspx%20from%20loading%20first%20record%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2778266%22%20slang%3D%22en-US%22%3E%3CP%3EI%20recently%20noticed%20that%20a%20customized%20PowerApp%20Canvas%20App%20will%20load%20the%20first%20record%20of%20a%20list%20instead%20of%20presenting%20the%20user%20with%20the%20new%20form%20as%20expected.%20I%20suspect%20it%20has%20to%20do%20with%20the%20default%20SharePointForm-%26gt%3BFormScreen-%26gt%3Bitem%20logic%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf(IsBlank(SharePointIntegration.Selected)%20%7C%7C%20IsEmpty(SharePointIntegration.Selected)%2CFirst(%5B%40%3CLIST%20name%3D%22%22%3E%5D)%2CSharePointIntegration.Selected)%3C%2FLIST%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20if%20I%20change%20the%20logic%20to%20remove%20the%20%22First%22%20item%2C%20it%20will%20still%20load%20the%20first%20record.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt's%20random%20and%20refreshing%20the%20browser%20is%20a%20workaround%20which%20will%20correctly%20load%20the%20%22newform.%22%20I%20can%20replicate%20the%20issue%20on%20any%20site%20collection%2C%20in%20any%20customized%20form.%20The%20form%20doesn't%20even%20need%20to%20have%20any%20advanced%20customization%20to%20replicate.%20Just%20publishing%20and%20replacing%20the%20SharePoint%20form%20with%20an%20unaltered%20Canvas%20App%20causes%20the%20issue.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBtw%20-%20saving%20the%20form%20with%20the%20%22First%22%20record%20will%20alter%20the%20record%20and%20does%20not%20create%20a%20new%20item.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2778266%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECanvas%20App%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerApps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2788171%22%20slang%3D%22en-US%22%3ERe%3A%20How%20do%20I%20stop%20SharePoint%20customized%20canvas%20app%20newform.aspx%20from%20loading%20first%20record%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2788171%22%20slang%3D%22en-US%22%3E%3CP%3EPersonal%20update%3A%20It%20only%20is%20our%20tenant.%20The%20behavior%20is%20exhibited%20on%20all%20forms%20no%20matter%20how%20complex%20(or%20not).%20I%20would%20be%20curious%20to%20know%20if%20any%20other%20tenants%20have%20this%20behavior%2C%20especially%20GCC%20tenants.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20tried%20to%20replicate%20on%20a%20developer%20tenant%20and%20could%20not%20get%20this%20bug.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

I recently noticed that a customized PowerApp Canvas App will load the first record of a list instead of presenting the user with the new form as expected. I suspect it has to do with the default SharePointForm->FormScreen->item logic:

 

If(IsBlank(SharePointIntegration.Selected) || IsEmpty(SharePointIntegration.Selected),First([@<list name>]),SharePointIntegration.Selected)

 

But if I change the logic to remove the "First" item, it will still load the first record.

 

It's random and refreshing the browser is a workaround which will correctly load the "newform." I can replicate the issue on any site collection, in any customized form. The form doesn't even need to have any advanced customization to replicate. Just publishing and replacing the SharePoint form with an unaltered Canvas App causes the issue.

 

Btw - saving the form with the "First" record will alter the record and does not create a new item.

4 Replies

Personal update: It only is our tenant. The behavior is exhibited on all forms no matter how complex (or not). I would be curious to know if any other tenants have this behavior, especially GCC tenants.

I tried to replicate on a developer tenant and could not get this bug.

It appears this is a Microsoft bug. they have put out an advisory which I hope is solved and thus solves this issue.
From Microsoft Message Center: "Users' custom Power Apps forms are loading incorrect items intermittently in SharePoint Online SP287734
September 27, 2021 2:10 PM
Title: Users' custom Power Apps forms are loading incorrect items intermittently in SharePoint Online

User Impact: Users' custom Power Apps forms are loading incorrect items intermittently in SharePoint Online.

More info: Users may experience temporary alleviation by refreshing the page, and, if linked to DispForm.aspx, may also bypass the issue by putting the form into edit mode, which can be done by clicking the 'edit all' button.

Additionally, users can experience alleviation by linking to the list instead of the item. When the list is opened and items are selected, they load as expected.

Current status: We're analyzing case details to diagnose the source of impact so we can identify a remediation strategy.

Scope of impact: Any user attempting to load custom Power Apps forms via SharePoint Online may experience impact.

Next update by: Monday, September 27, 2021, 3:30 PM (7:30 PM UTC)"
best response confirmed by Justin-GOV (Occasional Contributor)
Solution
Microsoft fix:

September 28, 2021 2:26 PM


Current status: Following our internal testing and validation, we've deployed our code fix which is designed to remediate impact. We're monitoring the deployment and expecting for it to complete and resolve the impact by Tuesday, September 28, 2021, at approximately 10:30 PM UTC.



Scope of impact: Any user attempting to load custom Power Apps forms via SharePoint Online may experience impact.



Estimated time to resolve: Within the next three to four hours. Root cause: A frame reload is occurring midway through the data communication process between Power Apps and SharePoint Online, resulting in intermittent impact.



Next update by: Tuesday, September 28, 2021, 6:30 PM (10:30 PM UTC)
Something that could help users self-mitigate issues in the SharePoint Integration component is enabling custom forms to access URL parameters. Not sure if this is feasible, but would have been very useful.