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

Patching or updating a nested collection is not working?

 

ClearCollect(
Coll_Products,
{
Id: 1,
Title: "Apple",
coll_types: [
{
Id: 1,
color: "Red"
},
{
Id: 2,
color: "Green"
}
]
},
{
Id: 2,
Title: "Grapes",
coll_types: [
{
Id: 1,
color: "Black"
},
{
Id: 2,
color: "Green"
}
]
}
);

Patch(Coll_Products,Lookup(Lookup(Coll_Products,Id=2).coll_types,Id=1),{color:"purple"});
//or
Patch(Coll_Products,Lookup(Lookup(Coll_Products,Id=2).coll_types,Id=1),{color:"purple"});
//or
Patch(Lookup(Coll_Products,Id=2).coll_types.Value,Lookup(Lookup(Coll_Products,Id=2).coll_types,Id=1),{color:"purple"});

 

We are trying to update nested collection color value based on Id but we are returning with an error (Patch has invalid arguments).

 

None of the statements are ain't working to update the nested collection value.

 

Can any buddy help me with this?

1 REPLY 1
v-qiaqi-msft
Community Support
Community Support

Hi@nsaiteja,

Based on the issue that you mentioned, do you want to access and update the record in the nested collection?

Have seen the formula you provided, the BaseRecord you want to update is specified as Id which will run the risk of duplicate references. 

Here is an article you can check for details:http://powerappsguide.com/blog/post/data---how-to-access-nested-collectionstables

 

Best Regards,

Qi 

Best Regards,
Qi

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,242)