Environment Variables – Part 3 and Bonus Substring Function

Welp. I am defeated. I promised a resolution to the issue I was facing with the scenario described in yesterday’s post. Alas, I return empty handed…

…but I wanted to at least keep up the post for the challenge. So instead, I thought I’d share something I geeked out about earlier today. For the more experienced Flow Creators out there, this is old hat I’m sure. For me, though? Pure gold!

Meet…(drum roll please)…the substring function!

explanation of substring function

For the uninitiated like myself, the substring function will take a string, allow you to select the starting position within that string, select the amount of characters within the length that you also select and then capture it in a variable.

For example, you’ll see in the screen shots below that I’m getting the Start Time from an appointment record, converting the UTC base time to Eastern Standard with a specific string format of “[Day of Week], [Month] [Day], [Year] [HH:MM]”. This is to satisfy another requirement that the client had to generate a PDF document from a Word template and put it into a specific folder structure in SharePoint that followed the days of the week.

So, we came up with the idea to generate the date string, based on the date selected by the customer, so that we could use the substring function to pull the first 3 letters from the day of the week. Notice in the folder path that I’m taking the output from the substring conversion and using it to create the folder from the portion of the date we caputre at the start!

Like I said, may not be cool to the old guard but for some of us who are just now fully appreciating Automate to its full, waranted degree? I thought it was pretty slick.

Happy creating!

DC

Published by

Dick Clark

I like Power Platform. Like, a lot.

Leave a Reply