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:
Even after passing the information into the string variable, the Flow gives an error about the value being 'Object.'
Any help is appreciated. Thanks!
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.
@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.
WarrenBelz
146,618
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,957
Most Valuable Professional