cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rayanp
Frequent Visitor

How to convert to Accounting format

Help!

 

May I know how can I set the Unit Cost and Total Cost into Number / Accounting Format

 

rayanp_0-1645497332284.png

 Here is the flow:

rayanp_1-1645497369804.png

rayanp_2-1645497443825.png

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @ScottShearer 
I tried using this expression based on this link but I am having an issue. Can you provide an explanation of what did wrong and what is the proper way I should do it?

 

How to convert a string to currency format in Power Automate

 

rayanp_1-1645516463431.png

 

 

 

 

View solution in original post

ScottShearer
Super User
Super User

@rayanp 

The issue is that you are initializing a variable inside of a loop which is not permitted.

Near the top of your Flow, add Initialize Variable actions for any variables that you are trying to initialize inside of a loop such as UnitCost and Formatted Unit cost.  Do not set the variables to any value - leave that part empty.

In the same place where you are currently initializing the variables, add Set Variable actions with the same expressions, etc. that you currently have in your Initialize variable actions.

Let me know how it goes.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

3 REPLIES 3
ScottShearer
Super User
Super User

@rayanp 

Th easiest way is to use a format number action (see below) but you could also use a formatNumber() expression.

Here is a link for info on the Format Number action

Here is a link on creating format strings

image.png

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer 
I tried using this expression based on this link but I am having an issue. Can you provide an explanation of what did wrong and what is the proper way I should do it?

 

How to convert a string to currency format in Power Automate

 

rayanp_1-1645516463431.png

 

 

 

 

ScottShearer
Super User
Super User

@rayanp 

The issue is that you are initializing a variable inside of a loop which is not permitted.

Near the top of your Flow, add Initialize Variable actions for any variables that you are trying to initialize inside of a loop such as UnitCost and Formatted Unit cost.  Do not set the variables to any value - leave that part empty.

In the same place where you are currently initializing the variables, add Set Variable actions with the same expressions, etc. that you currently have in your Initialize variable actions.

Let me know how it goes.

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,404)