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 / Updating Rows in Datav...
Power Automate
Unanswered

Updating Rows in Dataverse Table based on Array Result

(0) ShareShare
ReportReport
Posted on by 67

Hello,

 

I am building a flow to update the exchange rate of the currencies in my "Currencies" Table using an API from the 'Get Exchange Rates' Action based on the video: How to filter a JSON object with dynamic keys with Power Automate - YouTube

Capture.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The output of Action called Select is as follows:

 

{
 "body": [
 {
 "Currency": "USD",
 "Rate": "1"
 },
 {
 "Currency": "AED",
 "Rate": "3.6725"
 },
 {
 "Currency": "AFN",
 "Rate": "71.154"
 },
 {
 "Currency": "ALL",
 "Rate": "95.1122"
 },
 ...
 ,
 {
 "Currency": "ZWL",
 "Rate": "5798.6005"
 }
 ]
}

 

 

 In the Dataverse Table 'Currencies', how can I update the 'exchangerate' (based on the relevant 'isocurrencycode', where the 'isocurrencycode' column should be equal to the 'Currency' Key in the returned output above)? I am not being able to set the new rate.

 

Eg: If the returned Dataverse row's 'isocurrencycode' is 'USD', the 'exchangerate' should be set to 1 (as returned above by Select).

Categories:
I have the same question (0)
  • Verified answer
    v-yueyun-msft Profile Picture
    on at

    Hi , @Joseph_Nasr 

    According to your description, you want to update the Dataverse table.

    This is my flow:

    vyueyunmsft_0-1701833648337.png

    The result in the table is like this:

    vyueyunmsft_1-1701833663505.png

    You can refer to this screenshot:

    vyueyunmsft_2-1701833823855.png

    item()?['Currency']
    length(outputs('List_rows')?['body/value'])
    int(0)
    outputs('List_rows')?['body/value']?[0]?['cr667_currenciesid']
    float(items('Apply_to_each')?['Rate'])
     
    You need to replace your initial column name in your side.
    vyueyunmsft_3-1701833994494.png

     

     

    Best Regards,

    Yueyun Zhang

  • Joseph Nasr Profile Picture
    67 on at

    Hi @v-yueyun-msft,

    Thank you so much for the assistance. It is working, but the flow is getting marked as failed because it is also trying to modify the exchangerate of the base currency which in my case right now is US Dollar (isocurrencycode: USD).

     

    Where should I add the condition that isocurrencycode should not be equal to USD?

  • v-yueyun-msft Profile Picture
    on at

    Hi , @Joseph_Nasr 

    Do you mean you want to judge by the specail isocurrencycode in your Excel file?

    If this , you can add the condition here to judge if the isocurrencycode="USD".

    You can use the items('Apply_to_each')?[Curreny] to get your isocurrencycode in the 'Apply to each' loop.

    vyueyunmsft_0-1701855926888.png

     

    If I misunderstand what you mean, you can give me some sample data and the end result you want to get so that I can help you better!

     

    Now I'm off work lala.., and I'll get back to you tomorrow if need !

     

    Best Regards,

    Yueyun Zhang

  • Joseph Nasr Profile Picture
    67 on at

    Nevermind I added it in the condition but it added a ForEach on its own. Nevertheless it is working! Thank you so much

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 523 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard