web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract elements from ...
Power Automate
Unanswered

Extract elements from array and then update their fields using Logic Apps

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I wish to grab the elements in the Feedbacks array:

and then update two fields within that ids array:

 

 

 

   "Feedbacks":

                  [

                     {

                        "ids": "1234"

                    }

                   {

                        "ids": "4567"

                   }

                     

                 ]

 

update this:

 

"id": "1234"

"Features": 

       [

                {

             "id": "change this"

              "status": "change this"

               }

       ]

 

"id": "4567"

"Features": 

       [

                {

             "id": "change this"

              "status": "change this"

               }

       ]

 

 

 

I believe I may have to do this, does this look correct please, is this the correct approach?

Create two local variables that will update status and id.

I am seeing that I cannot dynamically put in the 'FeatureID' on variable 2 though because it is globally above the CDS step.

 

 

Does this appear correct? Any suggestion is appreciated. Thank you

jasmine2020_0-1597164922712.png

 

jasmine2020_1-1597164922716.png

 

 

Categories:
I have the same question (0)
  • Patrick Hess Profile Picture
    on at

    jasmine2020,

     

    I might need a bit more background on this to comment properly.

     

    First question, are you in proper Azure LogicApps for this or are you in Power Automate? They're very similar now but different enough that it could be a factor, many connectors behave differently and LogicApps tends to be more customizable. You may need to seek guidance from the appropriate forums if so.

     

    You should just need to use a Filter Array step such as what is outlined here:
    https://sharepains.com/2018/12/18/microsoft-flow-filter-data-in-an-array/

     

    With your Feedbacks variable, assuming that is an Array type, you should be able to put that variable into a Filter Array and then you can pull specific information from it.

     

    Another example of a similar approach:
    https://powerusers.microsoft.com/t5/Building-Flows/Extracting-one-value-from-an-array-using-Select/td-p/182073

     

    For even more:
    https://docs.microsoft.com/en-us/power-automate/data-operations

     

    Let us know!

     

    Sincerely,
    Patrick

  • jasmine2020 Profile Picture
    Microsoft Employee on at

    Thank you Patrick, I will check out all the links you provided. Also, I am in proper LogicApp, not Powerautomate. I am not sure which forum to post to?

     

    Here is a bit more information that I posted:

     

    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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard