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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch function for use...
Power Apps
Answered

Patch function for user data update works not always (network error)

(0) ShareShare
ReportReport
Posted on by 17

Hi everyone!

 

I am pretty new in Power Platform and probably my question had been already asked and solved before (I checked the similarly looking ones but could not find exact one so would be glad to get any references to similar situation).

 

Basically I have PowerApps app where users can create/edit their posts. Admins have instant approval, the regular users will have to wait for admins to approve the post first.

I have a form to submit and to SharePoint and combobox outside of the form with which we patch the last submission. (I tried to do the combobox within the form but SP just would not get the users data and patching failed completely so I chose to divide). The post goes to PowerAutomate to approve the post if user is admin or send notification to admins. Well, the SP site and app itself were established for learning so the members have Edit permission and I added some of the names of my colleagues as members just to test if the problem was in adding non-members but that theory failed. I myself is the owner and admin.

 

So the combobox has user names in it (taking DisplayName from 365users) and SP has a list called Posts that has data from the form and users column that allows the multiple choices. Usually the first try (submitting the new post) goes smoothly - submission done, last submitted post gets patched, the result goes through the Power Automate. (only tested while being admin though). The problem starts with editing posts. It is held through the same page and the same button as new posts so maybe it is the issues, but the error occurs pretty randomly: 1) adding users can work on the 2nd sometimes 3rd time but in more trials causes the error that colors my Patch function red; 2) removing 1 of the users would always trigger the error (works onlyif I remove all the users though). 

When error is triggered the data even does not get through the Power Automate completely (the submitted part goes but not the patch) resulting the post created by admin being Pending on SP hence needing approval.

 

The Save button has the following OnSelect:

SubmitForm(Form1);
Set(
userArray,
Concat(
ComboBox1.SelectedItems,
UserPrincipalName & ";"
)
);
Patch(Posts,
LookUp(Posts, ID = Form1.LastSubmit.ID),
{
AccessUsers: ForAll(
ComboBox1.SelectedItems,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: Concatenate("i:0#.f|membership|", Lower(UserPrincipalName)),
DisplayName: DisplayName,
Email: Mail,
Department: ".",
JobTitle: ".",
Picture: "."
}
)
});
createpost.Run(Form1.LastSubmit.ID, userArray);    //PowerAutomate action

//Set userArray was one of my trials to do patching through actions on PowerAutomate side but even before me doing the array thing, the same Networking error would happen so I am not sure what I am doing wrong. When error is happening Power Automated gets the submition through showing that the empty (or the before-change) array of users was submitted and only saves the form's changes, not the combobox. 

 

If anyone has an idea if I can simplify process and avoid an error or additional details are needed to detect the issue, please let me know. Thank you for your kind attention and consideration.

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @asa9 ,

     

    Could you please tell why you are using Office 365 Users connector (search user action, I believe) as the data source of that Combo box? If you use the default AccessUsers filed in Edit form, with the default Choices(Posts.AccessUsers) as the data source, there wouldn't be problems. Would you like to select external users in AccessUsers field? That will cause a lot of issues especially for a people column allows multiple selections. O365Users.SearchUser can only retrieve up to 1000 users from the tenant, so, when editing an existing item, one or more uses in the field may not be included in the first 1000 users and will cause the Patch error.

     

    Best regards,

  • asa9 Profile Picture
    17 on at

    Hello, Jeffer Ni!

     

    The reason I use Office 365 Users connector for Items of the Combobox is because on default Posts.AccessUser column is empty and it has no relations with the members of the site so the choices are empty if the post is not yet published if I use Posts.AccessUser... I do have Roles table on SP site where I do have user data and I first tried to use it as the source but when I submitted posts I remember it failed to save users so I started to look for the alternative ways to solve the problem. 

     

    UPD: I returned to addressing SP table and ended up submitting form without separate combobox and it worked just fine. Thank you for your kind help and guidance! 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard