cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver I
Resolver I

Replace expression in flow

I am trying put a replace expression on my flow 

 

replace(body('Get_file_content_-_HTMP_Template')'$CreatedTimestamp',triggerBody()?['Created'])

So its getting file content and its should be replacing the $Createdtimestamp that is in the template html to the created by name on my sharepoint list 

 

But its ssaying its invalid, Is it due to my replace name having the $ sign? should these be in { or is it something else i am missing. 

1 ACCEPTED SOLUTION

Accepted Solutions

Was an error in my bit of code/expression above

replace(body('Get_file_content_-_HTMP_Template'), '{Address}' ,body('Get_item')['Title'])

as you can see i missed some commers and spaces, This worked and i have now built a flow that converts a sharepoint item to a HTML template file with company logo, i then convert this file to a PDF, The next part of the flow picks up the attachments and creates a file for those under the same document libarary i have the PDF.

 

The above youtube gave me part of what i needed

 

I watched the start of this (as the rest is not really needed to understand what is required) to get the attachment https://www.youtube.com/watch?v=PQFTmWOHe8k&feature=youtu.be

 

And i created a template HTML file using another flow so i could get my logo in there, was a one time run and worked well.

 

SO i have been able to do what i wanted to achive.

 

 

 

To make a template HTML file that contained my company logo i created a one time flow and a logo stored in my onedrive

 

 

View solution in original post

5 REPLIES 5
Dual Super User II
Dual Super User II

Hey @amyharkus86 

 

Can you share more details on the scenario you are building? Can you share a screenshot of the flow and the error so that we can better identify the issue. 

 

From the expression I can see that you are trying to replace the body of the get content action (note that the body here is a blob so you do not really have an option to change metadata here unless you are populating a template)

 

If you can share a screenshot we might be able to better assist you,. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Yes i've got a template HTML document saved in SharePoint libary that i am using as a template to create a document that will also be saved to a document libary. 

 

Here is my flow 

 

replace 2.JPGReplace 1.JPG

my intention is to replace all $nametag to the correct names in the list items 

In my HTML i have

 

 <td width=601 valign=top style="width:450.8pt;border:solid windowtext 1.0pt; border-top:none;padding:0cm 5.4pt 0cm 5.4pt">
<p class=MsoNormal style="margin-bottom:0cm;margin-bottom:.0001pt;line-height: 200%"><span style="font-size:12.0pt;line-height:200%">$Observations</span></p>

for this one i want to replace $Observations for observation in my sharepoint list 

 

replace 3.JPG

The idea being that at the end it will create a form that the user can print out, that will look a bit like this 

Replace 4.JPG 

I also need to add the attachments to the photo document and our company logo but need to make sure it populates the data first! 

then these document will be saved in sharepoint and can be printed if/when required. 

 

Please let me know if you need more information.

 

Hey @amyharkus86 

 

I am not sure if it is going to work that way (especially the connector will not identify the placehoolders like that). You might want to create a file from scratch for this and populate information freshly. For placeholders and that type of stuff, it is recommended to use Word Templates. It is a premium connector though. There is one other premium connector using which you can populate the place holders in word templates with images and html as well. More details here:https://www.bythedevs.com/post/how-to-populate-word-template-with-rich-text-image-repeating-content-... 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

I've followed youtube about doing this and it seems to be doable, - https://www.youtube.com/watch?v=4OJDkBBEdhI  

 

but i think i must be doing somehting in correct in the compose part of the flow. 

Was an error in my bit of code/expression above

replace(body('Get_file_content_-_HTMP_Template'), '{Address}' ,body('Get_item')['Title'])

as you can see i missed some commers and spaces, This worked and i have now built a flow that converts a sharepoint item to a HTML template file with company logo, i then convert this file to a PDF, The next part of the flow picks up the attachments and creates a file for those under the same document libarary i have the PDF.

 

The above youtube gave me part of what i needed

 

I watched the start of this (as the rest is not really needed to understand what is required) to get the attachment https://www.youtube.com/watch?v=PQFTmWOHe8k&feature=youtu.be

 

And i created a template HTML file using another flow so i could get my logo in there, was a one time run and worked well.

 

SO i have been able to do what i wanted to achive.

 

 

 

To make a template HTML file that contained my company logo i created a one time flow and a logo stored in my onedrive

 

 

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (6,688)