cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sammybridge
Helper IV
Helper IV

ForAll Patching user record in CDS

I am looking to patch my user collected data from a collection into the Common Data Source but can't get it working. When using SharePoint to do this, I have to patch the full record data but I can't figure out how to do this on CDS. This is the code below that I have working perfect on SP but the bit in red is what I need to replicate on CDS and can't get working.

 

ForAll(
pimasscol,
Patch(
ProductBrief,
First(
Filter(
ProductBrief,
ID = ThisItem.ID
)
),
Defaults(ProductBrief),
{
'Project PIM': {
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & EmailName_Column,
Department: "",
DisplayName: Project_PIM_Column,
Email: EmailName_Column,
JobTitle: ".",
Picture: "."
}
}
)
)

1 ACCEPTED SOLUTION

Accepted Solutions

If your combo box is a list of people records vs just names, then you just need to collect it as Combobox.Selected. Else if your combobox is just a list of names, then you need to collect the record with something like Lookup(Users, 'Full Name' = Combobox.Selected.Value)

I assumed Users is the entity where you have the records. Also you might have to modify .Value to .Name or something.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

View solution in original post

5 REPLIES 5
PowerAddict
Super User II
Super User II

Are Claims, Department, DisplayName, Email, JobTitle, and Picture fields of the same entity in CDS? If all of this data is stored in a collection, you can simply use the collection to patch values to these as follows:

Claims: Collection1.Claims
Department: ""
DisplayName: Collection1.DisplayName

and so on and so forth.

Let me know if this helps and if not, what am I missing.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://www.thepoweraddict.com

Hello,

I’m maybe overcomplicating it. What I want to do is use a People Picker field, collect the selected name, then Patch the name from the collection to my Entity. When I try and do this though, it treats it as Text rather than a Record. How do I create a Record in my collection to then Patch to my Entity?

Thanks for your help

If your combo box is a list of people records vs just names, then you just need to collect it as Combobox.Selected. Else if your combobox is just a list of names, then you need to collect the record with something like Lookup(Users, 'Full Name' = Combobox.Selected.Value)

I assumed Users is the entity where you have the records. Also you might have to modify .Value to .Name or something.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com

View solution in original post

That’s worked. Thank you so much for your help!

Glad I could help! Good luck with the rest of your app! Feel free to reach out in case of any questions!

Thanks,
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (93,696)