cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jasmine2020
Microsoft
Microsoft

LogicApp that updates nested arrays within CosmosDB document

 

Background:

I have two different containers:

Features container and Feedback container.

 

 

 

Features container looks like this: It has a FeaturesID and a Feedbacks array that contains ids.

jasmine2020_0-1597430959858.png

 

 

Feedbacks container looks like this: It has a Features array that contains an id that points back to the Feature it belongs to

jasmine2020_1-1597430959843.png

 

 

 

 

I wish to change/update the contents within the Features array that belong to the Feedback container.  The id within the Features array (which is in the Feedback container) point to the FeatureID that is in the Feature container.

 

 

 

In order to change/update the items within the Features array that is within the Feedback container, my approach was/is to:

 

 

 

To retrieve the Feedback ids where the state is "LinkRequested" and where the id is >15.

(This result tells me these are all the Feedbacks whose Features need to be placed into CRM)

 

 

 

This result gives me all the Feedback ids that point to the Features that need to be pushed to CRM. Then I must update their Features arrays 'ids' and 'state' with the new CRM id that was auto generated from CRM.

 

jasmine2020_2-1597430959851.png

 

jasmine2020_3-1597430959854.png

 

 

The output ids from this query are the ids that point to the FeatureID  (in the Feature container) that need to be pushed to CRM.

 

 

To do this, would I need to perform a second query on this output to retrieve the actual FeatureID records?

 

jasmine2020_4-1597430959849.png

 

 

(I was not able to do this above. I am having difficulty with how to retrieve the actual record from the first query that looks like this:

jasmine2020_5-1597430959856.png

 

 

And then once these Features documents are pushed into CRM, I need to go back to the Feedback container and update the Features array within them to reflect the new ID that CRM has given as well as change the state name. (I think I can do this by parsing the data and filling in the actual document dynamically?)

 

jasmine2020_6-1597430959857.png

 

 

I will be working on this and any insight is greatly greatly appreciated.

Thank you

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (1,928)