Adding a variable to a file name

I am trying to add a variable to a file name. The variable takes the date from a Gsheet. When I try to add the variable to the file name I get an error that I am not familiar with.

1 Like

Hi @roberts.kyle

Try like this

"ShiftChangeDocument"+TodaysDate.toString

Convert the TodaysDate variable to string then concatenate with the text, then it will work.

Hope it helps!!

Absolutely perfect, thank you! I am not versed in coding or anything but I still like to know why things work the way they do. What is the reasoning for changing the variable to a string or is there literature I can follow to start building my knowledge around how these things work?

You are amazing either way!

1 Like

Thank you @roberts.kyle

If you see the image in the above post. In expression editor they mentioned string in the closed braces, it means this will accept only the string format values or expressions.
You are concatenating the text which is in with in double quotes is already in String format. The TodaysDate variable is in other datatype I think it is in DateTime datatype, when you are concatenate we have to change the TodaysDate to String format by using .toString then it will convert the data to String format. The concatenation will works and expression editor rule is satisfied.

I hope you understand the reason why we used .toString converter method. If you find the solution, Make mark it as solution to close the loop.

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.