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 blog
Power 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 blog
Power Automate Video Tutorials
Anonymous
Not applicable

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

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 (4,666)