Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

LogicApp that updates nested arrays within CosmosDB document

Posted on by 75

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.

 pastedimage1597434004604v4.png

 

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

 

 

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

 

pastedimage1597434044220v5.png

 

pastedimage1597434059836v6.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?

 

pastedimage1597434078466v7.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:

 pastedimage1597434097043v8.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?)

 pastedimage1597434130719v9.png

 

 

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

Thank you

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans