Make Your Cloud Flows Run Faster with Power Automate Expressions

By Herb Johnson | January 3, 2024

Power Automate Cloud Flows Expressions

Expressions are an important part of cloud flows, and having a solid knowledge of what you can do with expressions to help your cloud flows run faster and perform better is equally important.

Cloud flows are a core functionality of Power Automate that allows you to automate tedious and repetitive tasks so that your team can focus on work that brings more value to your organization.

How to Add Expressions to Power Automate Cloud Flows

You can access some great information on cloud flows on Microsoft's website. Below, we are going to take a look at some common use cases and how we used Power Automate (Cloud Flow) expressions to solve them.

1. Remove the first and last characters from a string. 

  1. This guid has the curly bracket on each end that needed to be removed
    1. {D3C2521B-AB7D-EE11-8179-6045BD006F9A}
  2. substring(triggerBody()?['Guid'],1,sub(length(triggerBody()?['Guid']),2))
    1. Result: D3C2521B-AB7D-EE11-8179-6045BD006F9A

2. Get the first item in from a string delimited by a colin.

  1. This string is a list of items separated by the :
    1. Vikings:24Packers:10
  2. b. first(split(items('Apply_to_each_-_ImcomingData'),':'))
    1. Result:Vikings

3. The grand total needs to be in currency format.

  1. 10000.50
  2. formatNumber(variables('varGrandTotal'), 'C2')
  3. Result: $10,000.50

4. Show only the date from createdon date.

  1. The column includes data and time
    1. 2021-07-26T20:41:47Z
  2. formatDateTime(items('Apply_to_each')?['createdon'],’MM/dd/yyyy’)
  3. Result: 07/26/2021

5. Create a link to the flow run so we can put it in a log table

  1. Utilized the concat expression to build a url for the flow run. It also includes the workflow express to get data to include in the url.
  2. concat('https://us.flow.microsoft.com/manage/environments/', workflow()?['tags']?['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])
    1. Result: A link to the run of the flow

6. Add 1 month to Realized Revenue Start Date. 

  1. 05/17/2024
  2. addToTime(triggerBody()?['realizedRevenueDateStart'] , 1, 'Month', 'MM/dd/yyyy')
  3. Result: 06/17/2024

7. Get the last day of next month. 

  1. 11/8/2023
  2. b. formatDateTime(addDays(startOfMonth(addToTime(utcNow(),2,'Month','MM-dd-yyyy')),-1),'MM-dd-yyyy')
  3. Result: 12-31-2023

As always, it's important to test to make sure you get the desired outcome.

Check back for more information on Cloud Flows in Power Automate!

Stoneridge Stoftware's team of experts can help you use Power Automate and the entire Power Platform to enhance your business processes. Get in touch with us to learn more. 


Under the terms of this license, you are authorized to share and redistribute the content across various mediums, subject to adherence to the specified conditions: you must provide proper attribution to Stoneridge as the original creator in a manner that does not imply their endorsement of your use, the material is to be utilized solely for non-commercial purposes, and alterations, modifications, or derivative works based on the original material are strictly prohibited.

Responsibility rests with the licensee to ensure that their use of the material does not violate any other rights.

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!