cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Update a value in a nested collection

Hi to all, 

 

I am trying to update a specific value in a nested collection, 2nd level. The collection has been created by grouping a table. The lines in the inner collections have IDs, so I can easily identify the ID to update. 

 

Can anyone provide the syntax?

 

I tried both UpdateIf and Patch statement, without success...

For example: 

UpdateIf(outercollection;innercollection.mont_f_id = gallery5.selected.mont_f_id;{innercollection: 

 

PowerApps is just proposing for the curly brackets statement this one statement: {innercollction:

 

I tried a patch statement and am desparate now...anyone with a solution??

 


Collection1.pngInnerCollection.png

 

Thank you and best regards

 

TheSwissPowerAppsEnthusiast

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @baxschwepo ,

Do you want to update column value in a nested collection/table in your canvas app?

 

If you want to update column value in a nested collection/table in your canvas app using Update function or Patch function, I afraid that there is no way to achieve your needs in PowerApps currently.

 

The UpdateIf function or Patch function could only be applied to your original data source (e.g. a SP List, a SQL Table, a first level Collection, ...etc), it could not be used to update a column value inside nested collection.

 

As an alternative solution, you could consider find the specific record you want to update from your original data source (e.g. a SP List), and then update the specific record, then group your original data source again based on some columns. So please consider try the following formula (set the OnSelect property of a button to following😞

UpdateIf(
     'Your Original Datasource',
     Mont_f_id = Gallery5.Selected.Mont_f_id && ID = Gallery5.Selected.ID, // find record you want to update in your Orginal data source
     {
       Projekt_... : "Type Specific Value Here"
     }
);
// Re-group your original data source based on several columns again
ClearCollect(
             colMontWorkPlan,
             GroupBy('Your Original Datasource', "TagName", "String...", "Kalenderw..", "GrpStrDat")
)

or

Patch(
         'Your Original Datasource',
         LookUp('Your Original Datasource', Mont_f_id = Gallery5.Selected.Mont_f_id && ID = Gallery5.Selected.ID), // Find the record you want to update in your orginal data source
         {
           Projekt_... : "Type Specific Value Here"
         }
);
// Re-group your original data source based on several columns again
ClearCollect(
             colMontWorkPlan,
             GroupBy('Your Original Datasource', "TagName", "String...", "Kalenderw..", "GrpStrDat")
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Hi @baxschwepo ,

Do you want to update column value in a nested collection/table in your canvas app?

 

If you want to update column value in a nested collection/table in your canvas app using Update function or Patch function, I afraid that there is no way to achieve your needs in PowerApps currently.

 

The UpdateIf function or Patch function could only be applied to your original data source (e.g. a SP List, a SQL Table, a first level Collection, ...etc), it could not be used to update a column value inside nested collection.

 

As an alternative solution, you could consider find the specific record you want to update from your original data source (e.g. a SP List), and then update the specific record, then group your original data source again based on some columns. So please consider try the following formula (set the OnSelect property of a button to following😞

UpdateIf(
     'Your Original Datasource',
     Mont_f_id = Gallery5.Selected.Mont_f_id && ID = Gallery5.Selected.ID, // find record you want to update in your Orginal data source
     {
       Projekt_... : "Type Specific Value Here"
     }
);
// Re-group your original data source based on several columns again
ClearCollect(
             colMontWorkPlan,
             GroupBy('Your Original Datasource', "TagName", "String...", "Kalenderw..", "GrpStrDat")
)

or

Patch(
         'Your Original Datasource',
         LookUp('Your Original Datasource', Mont_f_id = Gallery5.Selected.Mont_f_id && ID = Gallery5.Selected.ID), // Find the record you want to update in your orginal data source
         {
           Projekt_... : "Type Specific Value Here"
         }
);
// Re-group your original data source based on several columns again
ClearCollect(
             colMontWorkPlan,
             GroupBy('Your Original Datasource', "TagName", "String...", "Kalenderw..", "GrpStrDat")
)

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

Hi community team,

 

I am doing it exactly how you proposed it. The disadvantage is, that the gallery where I am using the nested collection is losing the "selected" information. But I can live with it or find a different solution by saving the selected one to different collection.

 

Thank you for your fast response. Conclusion is, I am not too stupid for it, but it is not working.

 

Regards

 

Bernd 

 

The Swiss PowerApps Enthusiast

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (16,150)