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 

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (29,865)