cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ParadigmaNet
Frequent Visitor

Patch two person fields to SP List

Hello Community! I need assistance with the following. Trying to patch to person fields to a SP List. The app seems to be working fine and NOT returning any errors. However, only writes one of the fields "Agent". I have to separate person fields created: Agent and Requester. The Agent is been auto populated while the Requester is from a combo box using Office 365Users.SearchUser connector. Here is the code. Suggestion please.

 

// To create record

Patch(Tickets,
Defaults(Tickets),
{

Agent:'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & AssignTo.Staff.Email,
Department: "",
DisplayName: AssignTo.Staff.DisplayName,
Email: AssignTo.Staff.Email,
JobTitle: "",
Picture: "",


Requester: {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & cmbRequester_2.Selected.Mail,
Department: "",
DisplayName: cmbRequester_2.Selected.DisplayName,
Email: cmbRequester_2.Selected.Mail,
JobTitle: "",
Picture: ""
}
}

};

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @ParadigmaNet ,

You are missing a couple of brackets {}

Patch(
   Tickets,
   Defaults(Tickets),
   {
      Agent: 
      {
         '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
         Claims: "i:0#.f|membership|" & AssignTo.Staff.Email,
         Department: "",
         DisplayName: AssignTo.Staff.DisplayName,
         Email: AssignTo.Staff.Email,
         JobTitle: "",
         Picture: ""
      },
      Requester: 
      {
         '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
         Claims: "i:0#.f|membership|" & cmbRequester_2.Selected.Mail,
         Department: "",
         DisplayName: cmbRequester_2.Selected.DisplayName,
         Email: cmbRequester_2.Selected.Mail,
         JobTitle: "",
         Picture: ""
      }
   }
};

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

View solution in original post

Hi WarrenBelz! Surely enough missing {}. Could not figure out by myself. Beginner's mistake. 

Thank you for your help!

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @ParadigmaNet ,

You are missing a couple of brackets {}

Patch(
   Tickets,
   Defaults(Tickets),
   {
      Agent: 
      {
         '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
         Claims: "i:0#.f|membership|" & AssignTo.Staff.Email,
         Department: "",
         DisplayName: AssignTo.Staff.DisplayName,
         Email: AssignTo.Staff.Email,
         JobTitle: "",
         Picture: ""
      },
      Requester: 
      {
         '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
         Claims: "i:0#.f|membership|" & cmbRequester_2.Selected.Mail,
         Department: "",
         DisplayName: cmbRequester_2.Selected.DisplayName,
         Email: cmbRequester_2.Selected.Mail,
         JobTitle: "",
         Picture: ""
      }
   }
};

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

 

Hi WarrenBelz! Surely enough missing {}. Could not figure out by myself. Beginner's mistake. 

Thank you for your help!

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (4,226)