cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Effectively using the replace function on a variable

I am using a custom AI model to parse fields from an invoice. In my SharePoint list I have the "Total Amount Due" as a number as it should be. My challenge is sometimes the AI grabs just the amount while other times it grabs the $ in front of the amount. I assigned the value parsed from the PDF for "Total Amount Due" to a variable TotalAmountDue. I then add a "Compose" and use the function: 

replace([variables('TotalAmountDue')], '$', '')

 

It keeps telling me this is an invalid function yet the documentation on "Replace" shows: 

replace([columnname], '$', '')

 

 

I have seen others having similar issues but they are using a capital Replace or double quotes. I'm not making any of these mistakes.

 

What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @Anonymous 

 

Remove the square brackets. Please see below.

 

replace(variables('TotalAmountDue'), '$', '')



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

2 REPLIES 2
abm
Super User
Super User

Hi @Anonymous 

 

Remove the square brackets. Please see below.

 

replace(variables('TotalAmountDue'), '$', '')



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

Anonymous
Not applicable

Thanks, that did it perfectly. I was so close!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,103)