cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (5,592)