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 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

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (54,517)