cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gazzo1967
Impactful Individual
Impactful Individual

Can anyone Help with a Compose Expression?

Hi All

I have a flow which populates a HTML template from a Sharepoint list.

It works fine but i have to add a new field to the HTML which is populated by a Choice field but the formula failure states:

 

The template language function 'replace' expects its third parameter 'new string' to be a string. The provided value is of type 'Object'

 

Formula is

replace(outputs('Compose_DOA'),'{assno}',body('Get_item')?['assessment'])
 
how do you reference an object?

I have looked at the 'help' link but its clear as mud 😞

 

Thanks Gary

1 ACCEPTED SOLUTION

Accepted Solutions
gazzo1967
Impactful Individual
Impactful Individual

I have solved this after researching different answers to other requests on this site

all i had to do was add this value to my original expression

?['Value']

Original expression

replace(outputs('Compose_DOA'),'{assno}',body('Get_item')?['assessment'])

 

So the formula should be

replace(outputs('Compose_DOA'),'{assno}',body('Get_item')?['assessment']?['Value'])

 

View solution in original post

6 REPLIES 6
abm
Super User
Super User

Hi @gazzo1967 

 

Could you please show you run history values of this object?  



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
gazzo1967
Impactful Individual
Impactful Individual

@abm 

here is the fail message

 

Unable to process template language expressions in action 'Compose_assess_number' inputs at line '1' and column '2781': 'The template language function 'replace' expects its third parameter 'new string' to be a string. The provided value is of type 'Object'. Please see https://aka.ms/logicexpressions#replace for usage details.'.

 

regards Gary

Hi @gazzo1967 

 

Could you please post the object runtime value from run history?



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
gazzo1967
Impactful Individual
Impactful Individual

@abm 

what do you mean ?

 

the message i have posted is the fail message from the test is that not what you require?

Gary

gazzo1967
Impactful Individual
Impactful Individual

@abm 

Your help is greatly appreciated 🙂

Here is a screen shot

Capture1.JPG

gazzo1967
Impactful Individual
Impactful Individual

I have solved this after researching different answers to other requests on this site

all i had to do was add this value to my original expression

?['Value']

Original expression

replace(outputs('Compose_DOA'),'{assno}',body('Get_item')?['assessment'])

 

So the formula should be

replace(outputs('Compose_DOA'),'{assno}',body('Get_item')?['assessment']?['Value'])

 

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 (1,708)