web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Trouble With People, D...
Power Automate
Unanswered

Trouble With People, Date, and Hyperlink columns using Replace Expression

(0) ShareShare
ReportReport
Posted on by

I have a rather involved flow that runs on a schedule daily. It checks to see if a list item has something that has been signed. If so, the requirement is to produce a PDF of that list item's columns in a library. To do that, there is a branch of logic that takes an HTML template with tokens and then has Compose actions for each token. In said compose action, I am attempting to use the replace function to replace the token with the value from the corresponding column in a SharePoint list. Presently, I have several types of columns in that list I am trying to pass through the compose function in order to eventually create a PDF file using the Create File (OneDrive) Flow template. The only column type I have been successful with is single line of text. Two that are not working are people columns, one is a date column, and one is a hyperlink. I'm pretty sure because my compose function is using replace that only text or string are supported based on the error.

 

The next bit of logic I tried was to add a 'Flow' column equivalent for each of the problematic columns, only make it single line of text. I then added an Initialize variable for each of the problem columns to make a string variable. I then Set the Variable using the column that was problematic (i.e., the people column). However, when I attempted to include my variable in the replace expression, it isn't saving. Something about my syntax seems to be off.

 

Any ideas on how to correct this would be appreciated. Below are my original and revised replace expressions, a high level of the Flow, and the error.

 

The original replace expression I used in the Compose template that produced the error about being and object and not string was as follows:  

replace(outputs('Compose_-_Set_Employee_Name'),'{employeesignature}',body('Get_item')?['Employee_x0020_Name'])

 

Even after passing the information into the string variable, the Flow gives an error about the value being 'Object.'

replace(outputs('Compose_-_Set_Title'),'{employeename}',variables('EmpName'))

 

Any help is appreciated. Thanks!

 

 

 

CreatePDFFromHTMLTemplateMergedWSPList.JPGErrorAboutComposeStep.JPG

Categories:
I have the same question (0)
  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    @Anonymous 

    Hi there.  Total shot in the dark, but have you already tried wrapping the whole thing inside of a String()?  Like this:

     

    String(replace(outputs('Compose_-_Set_Title'),'{employeename}',variables('EmpName')))

     

    Keep us posted.

    -Ed-

     

    If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

  • Community Power Platform Member Profile Picture
    on at

    Thank you for your suggestion. I certainly hadn't thought of that.

     

    It turned out that what I did initially with the variables eventually worked. Not sure if there was some sort of timer job running or it took so long before it recognized the variables. However, the next day, it was fine when I tried working on the Flow again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard