Currency Conversion List to List Calculation

%3CLINGO-SUB%20id%3D%22lingo-sub-1855363%22%20slang%3D%22en-US%22%3ECurrency%20Conversion%20List%20to%20List%20Calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1855363%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%26nbsp%3B%20I'm%20very%20new%20to%20all%20of%20this%2C%20so%20your%20expertise%20is%20required.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20two%20lists%2C%20one%20is%20my%20main%20list%20which%20will%20include%20a%20local%20currency%20amount%20column%2C%20with%20a%20column%20for%20what%20the%20local%20currency%20is.%26nbsp%3B%20In%20another%20list%20I%20have%20a%20currency%20conversion%20for%20each%20of%20the%20these%20currency%20-%20we%20don't%20want%20this%20to%20be%20a%20live%20link.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20question%20is.%26nbsp%3B%20What%20process%20or%20power%20automate%20do%20I%20use%20to%20make%20a%20column%20return%20the%20EUR%20amount%20(from%20the%20currency%20list)%20based%20on%20the%20amount%20and%20the%20currency%20in%20the%20main%20list%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1855363%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1856088%22%20slang%3D%22en-US%22%3ERe%3A%20Currency%20Conversion%20List%20to%20List%20Calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1856088%22%20slang%3D%22en-US%22%3EYou%20could%20use%20a%20Logic%20App%20to%20read%20for%20updates%20to%20the%20two%20lists%20and%20then%20use%20an%20Azure%20function%20to%20perform%20the%20calculation%20using%20the%20Graph%20API.%20The%20part%20I%E2%80%99m%20not%20clear%20on%20though%2C%20where%20do%20you%20want%20to%20store%20the%20EUR%20amount%3F%20In%20the%20main%20list%20on%20the%20same%20record%20where%20the%20local%20currency%20amount%20is%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1856734%22%20slang%3D%22en-US%22%3ERe%3A%20Currency%20Conversion%20List%20to%20List%20Calculation%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1856734%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sam%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F858042%22%20target%3D%22_blank%22%3E%40Sharepoint_Sam-Novice%3C%2FA%3E%2C%20yes%20you%20can%20do%20this%20quite%20easily%20with%20a%20flow%20in%20Power%20Automate%20and%20a%20button%20on%20your%20main%20list%20to%20trigger%20it.%20So%20for%20this%20example%20we've%20got%20our%20main%20list%20and%20a%20lookup%20list%20as%20shown%20below.%20The%20LocalCurrencyAmount%20column%20is%20a%20number%20column%20and%20the%20currency%20column%20is%20a%20single%20line%20of%20text%20column.%20The%20column%20where%20the%20button%20is%20is%20a%20single%20line%20of%20text%20column%20and%20I'll%20show%20the%20formatting%20of%20that%20further%20down.%20We've%20then%20got%20a%20currency%20column%20for%20the%20EUR%20amount%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220a-Main-List.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231613i3B5066594D6DB0AD%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220a-Main-List.png%22%20alt%3D%220a-Main-List.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20second%20list%20is%20the%20currency%20lookup%20list%20with%20one%20item%20for%20each%20currency%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%220b-Lookup-List.png%22%20style%3D%22width%3A%20766px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231612i222D0D069255A2F5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%220b-Lookup-List.png%22%20alt%3D%220b-Lookup-List.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBefore%20you%20do%20the%20button%20formatting%20you%20need%20to%20build%20the%20flow.%20The%20trigger%20is%20a%20SharePoint%20%3CEM%3EFor%20a%20selected%20item%3C%2FEM%3E.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20first%20action%20is%20a%20SharePoint%20%3CEM%3EGet%20item%3C%2FEM%3E%20to%20get%20the%20details%20of%20the%20item%20that%20was%20selected.%20In%20the%20ID%20field%20you%20select%20ID%20from%20the%20dynamic%20box%20on%20the%20right.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%221-Flow.png%22%20style%3D%22width%3A%20571px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231614iC599E46C6D23FD1B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%221-Flow.png%22%20alt%3D%221-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%20we%20want%20to%20look%20up%20the%20item%20in%20the%20lookup%20list%20that%20corresponds%20to%20the%20currency%20in%20the%20main%20list.%20So%20you%20do%20that%20with%20a%20%3CEM%3EGet%20items%3C%2FEM%3E%20action%20and%20in%20the%20advanced%20options%20there%20is%20a%20filter%20query%20field.%20So%20you%20type%20%3CSTRONG%3ETitle%20eq%20''%3C%2FSTRONG%3E%20and%20in%20between%20the%20apostrophes%20select%20Currency%20from%20the%20Get%20item%20from%20the%20Main%20List%20section%20of%20the%20dynamic%20content%20box%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%222-Flow.png%22%20style%3D%22width%3A%20584px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231619iBDA552369248D834%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222-Flow.png%22%20alt%3D%222-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%2C%20even%20though%20we%20are%20only%20bringing%20back%20a%20single%20item%20from%20lookup%20list%2C%20nevertheless%20add%20an%20Apply%20to%20each%20control%20and%20select%20value%20from%20the%20Get%20items%20from%20the%20Lookup%20List%20section%20of%20the%20dynamic%20content%20box.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%20add%20a%20couple%20of%20%3CEM%3ECompose%3C%2FEM%3E%20actions%20I've%20named%20the%20first%20one%20Compose%20Local%20Currency%20Amount%20and%20in%20the%20Inputs%20field%20I've%20selected%20LocalCurrencyAmount%20from%20the%20Get%20items%20from%20the%20Main%20List%20section%20of%20the%20dynamic%20content%20box.%20The%20second%20Compose%20action%20I've%20named%20Compose%20Exchange%20Rate%20and%20in%20the%20Inputs%20field%20I've%20selected%20ExchangeRatetoEuro%20from%20the%20Get%20items%20from%20the%20Lookup%20List%20section%20of%20the%20dynamic%20content.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%223-Flow.png%22%20style%3D%22width%3A%20623px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231616iDDF731AB78FFA418%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%223-Flow.png%22%20alt%3D%223-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%20we%20get%20the%20flow%20to%20multiply%20the%20Compose%20Local%20Currency%20Amount%20by%20the%20Comppose%20Exchange%20Rate.%20We%20do%20this%20with%20another%20Compose%20action%20and%20in%20the%20dynamic%20content%20box%20click%20the%20%3CU%3EExpression%3C%2FU%3E%20tab%20at%20the%20top%20and%20type%20mul(and%20then%20click%20the%20dynamic%20content%20box%20and%20select%20the%20Outputs%20of%20the%202%20Compose%20actions.%20Your%20expression%20will%20look%20like%20this%20with%20underscores%20erplacing%20the%20spaces%20(they're%20put%20in%20automatically)%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSTRONG%3Emul(outputs('Compose_Local_Currency_Amount')%2Coutputs('Compose_Exchange_Rate'))%3C%2FSTRONG%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224a-Flow.png%22%20style%3D%22width%3A%20968px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231620iE0AA16646B263203%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%224a-Flow.png%22%20alt%3D%224a-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinally%20we%20want%20to%20update%20the%20item%20in%20the%20main%20list%20with%20the%20calculated%20Euro%20amount.%20So%20select%20a%20SharePoint%20Update%20item%20action%2C%20enter%20the%20site%20and%20the%20main%20list%20and%20it%20will%20find%20the%20columns.%20For%20the%20ID%20select%20ID%20from%20the%20Get%20item%20from%20the%20Main%20List%20section%20of%20the%20dynamic%20content.%20For%20the%20EUR%20column%20select%20the%20output%20from%20the%20Compose%20EUR%20section%20of%20the%20dynamic%20content.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%225-Flow.png%22%20style%3D%22width%3A%20596px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231618i9383E7E572979ECF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%225-Flow.png%22%20alt%3D%225-Flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESave%20and%20name%20your%20flow%20and%20go%20to%20the%20main%20screen%20for%20the%20flow%20and%20copy%20the%20ID%20of%20it%20from%20the%20address%20bar%20at%20the%20top%20of%20the%20screen%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%226-Flow-ID.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231623i2BA3F2AEB5233E75%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%226-Flow-ID.png%22%20alt%3D%226-Flow-ID.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENext%20format%20the%20column%20in%20your%20main%20list%20which%20will%20have%20the%20button%20(in%20the%20advanced%20mode%20part%20of%20the%20format%20this%20column)%20and%20paste%20in%20the%20following%20JSON%20changing%20the%20flow%20ID%20to%20yours%20and%20the%20txtContent%20to%20whatever%20you%20want%20the%20text%20to%20be.%20There%20are%20other%20parts%20of%20the%20JSON%20you%20can%20also%20change%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22button%22%2C%0A%20%20%22txtContent%22%3A%20%22Calculate%20Euro%20Amount%22%2C%0A%20%20%22customRowAction%22%3A%20%7B%0A%20%20%20%20%22action%22%3A%20%22executeFlow%22%2C%0A%20%20%20%20%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%20%5C%22252e9ec9-eff4-412d-ba6e-06de5ac401fb%5C%22%2C%5C%22headerText%5C%22%3A%5C%22Calculate%20Euro%5C%22%2C%5C%22runFlowButtonText%5C%22%3A%5C%22Calculate%20Now%5C%22%7D%22%0A%20%20%7D%2C%0A%20%20%22style%22%3A%20%7B%0A%20%20%20%20%22background-color%22%3A%20%22%23468259%22%2C%0A%20%20%20%20%22color%22%3A%20%22white%22%0A%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20when%20a%20user%20clicks%20the%20button%20in%20the%20list%20it%20will%20trigger%20the%20flow%20and%20put%20the%20Euro%20amount%20in%20the%20column.%20The%20attached%20video%20shows%20this%20in%20action%20based%20on%20these%20lists%20and%20the%20flow%20above.%20I've%20compressed%20the%20time%20after%20the%20button%20has%20been%20clicked%20as%20it%20can%20take%20about%2010%20seconds%20for%20the%20Euro%20amount%20to%20be%20added%20into%20the%20list%20item.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20that%20helps%20but%20come%20back%20with%20any%20questions%20if%20something%20isn't%20clear.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

Hi all,  I'm very new to all of this, so your expertise is required.

 

I have two lists, one is my main list which will include a local currency amount column, with a column for what the local currency is.  In another list I have a currency conversion for each of the these currency - we don't want this to be a live link.  

 

My question is.  What process or power automate do I use to make a column return the EUR amount (from the currency list) based on the amount and the currency in the main list?

3 Replies
You could use a Logic App to read for updates to the two lists and then use an Azure function to perform the calculation using the Graph API. The part I’m not clear on though, where do you want to store the EUR amount? In the main list on the same record where the local currency amount is?

Hi Sam @Sharepoint_Sam-Novice, yes you can do this quite easily with a flow in Power Automate and a button on your main list to trigger it. So for this example we've got our main list and a lookup list as shown below. The LocalCurrencyAmount column is a number column and the currency column is a single line of text column. The column where the button is is a single line of text column and I'll show the formatting of that further down. We've then got a currency column for the EUR amount:

0a-Main-List.png

 

The second list is the currency lookup list with one item for each currency:

 

0b-Lookup-List.png

 

Before you do the button formatting you need to build the flow. The trigger is a SharePoint For a selected item

 

The first action is a SharePoint Get item to get the details of the item that was selected. In the ID field you select ID from the dynamic box on the right.

 

1-Flow.png

 

Next we want to look up the item in the lookup list that corresponds to the currency in the main list. So you do that with a Get items action and in the advanced options there is a filter query field. So you type Title eq '' and in between the apostrophes select Currency from the Get item from the Main List section of the dynamic content box:

 

2-Flow.png

 

Next, even though we are only bringing back a single item from lookup list, nevertheless add an Apply to each control and select value from the Get items from the Lookup List section of the dynamic content box.

 

Next add a couple of Compose actions I've named the first one Compose Local Currency Amount and in the Inputs field I've selected LocalCurrencyAmount from the Get items from the Main List section of the dynamic content box. The second Compose action I've named Compose Exchange Rate and in the Inputs field I've selected ExchangeRatetoEuro from the Get items from the Lookup List section of the dynamic content.

 

3-Flow.png

 

Next we get the flow to multiply the Compose Local Currency Amount by the Comppose Exchange Rate. We do this with another Compose action and in the dynamic content box click the Expression tab at the top and type mul(and then click the dynamic content box and select the Outputs of the 2 Compose actions. Your expression will look like this with underscores erplacing the spaces (they're put in automatically):

mul(outputs('Compose_Local_Currency_Amount'),outputs('Compose_Exchange_Rate'))

 

4a-Flow.png

 

Finally we want to update the item in the main list with the calculated Euro amount. So select a SharePoint Update item action, enter the site and the main list and it will find the columns. For the ID select ID from the Get item from the Main List section of the dynamic content. For the EUR column select the output from the Compose EUR section of the dynamic content.

 

5-Flow.png

 

Save and name your flow and go to the main screen for the flow and copy the ID of it from the address bar at the top of the screen:

6-Flow-ID.png

 

Next format the column in your main list which will have the button (in the advanced mode part of the format this column) and paste in the following JSON changing the flow ID to yours and the txtContent to whatever you want the text to be. There are other parts of the JSON you can also change:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Calculate Euro Amount",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"252e9ec9-eff4-412d-ba6e-06de5ac401fb\",\"headerText\":\"Calculate Euro\",\"runFlowButtonText\":\"Calculate Now\"}"
  },
  "style": {
    "background-color": "#468259",
    "color": "white"
  }
}

 

So when a user clicks the button in the list it will trigger the flow and put the Euro amount in the column. The attached video shows this in action based on these lists and the flow above. I've compressed the time after the button has been clicked as it can take about 10 seconds for the Euro amount to be added into the list item.

 

I hope that helps but come back with any questions if something isn't clear.

 

Rob
Los Gallardos
Microsoft Power Automate Community Super User

@RobElliott Thank you so much.  I'll give this a try, but wanted to thank you for such an in depth response which is easy to understand.