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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (3,467)