Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • Community Power Platform Member Profile Picture
    on at
    Re: Trouble With People, Date, and Hyperlink columns using Replace Expression

    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.

  • Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at
    Re: Trouble With People, Date, and Hyperlink columns using Replace Expression

    @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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,957 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow