Power Automate startsWith() Function [With Examples]

Do you want to know how to use the Power Automate startsWith() function? In this Power Automate tutorial, I will show the Power Automate startWith() function with its syntax.

I will also explain examples of the startsWith() function in Power Automate.

Power Automate startsWith() method returns a boolean value (true or false) indicating whether the specified string starts with the given substring.

Power Automate startsWith() Function

Microsoft Power Automate startsWith() function checks whether a provided string starts with a particular string value. The output of the startsWith() expression will always return the boolean values, which are true or false.

It is a set function, where the counterpart is the endsWith() function, which resembles the same functionality but for a string ending in Power Automate.

Example:

TextSearch TextOutput
Hello Lidia! Merry Christmas.Hellotrue

Refer to the image below.

Microsoft Power Automate startsWith() Function

Power Automate startsWith() function Syntax

The syntax of the startsWith() function in Power Automate is mentioned below.

startsWith('<text>', '<searchText>')

Input Parameters:

  • text (mandatory): The string to be evaluated.
  • searchText (mandatory): The starting string to locate.

Return Value:

  • Returns true if text starts with search text.
  • Returns false if text does not start with search text.

This is about the Power Automate startsWith() function syntax.

How to use Power Automate startsWith() Function

Here, I will demonstrate how to use the Power Automate startsWith() function with a few examples.

Example:1 [startsWith() function using SharePoint list]

I have used a SharePoint list named “Blog List” with a few columns and their data types.

ColumnsData Types
Blog Title(renamed Title column)Single line of text
Blog StatusChoice
Blog Publish DateDate and Time
Blog AuthorPerson and Groups
How to use startsWith() expression in Power Automate

In this list, I determined to check whether the SharePoint list column [Blog Title] begins with a specific substring value [Power Automate].

startsWith() function expression in Power Automate

To achieve this, follow the steps below.

1. Open the Power Automate home page by browsing https://make.powerautomate.com, click + Create -> Select Automated cloud flow -> Enter the flow name and choose your trigger (When an item is created or modified), then click Create.

Set the required fields for this trigger as shown below.

  • Site Address: Provide the specific SharePoint site address.
  • List Name: Select the name of the SharePoint list.
Power Automate startsWith() function using SharePoint list

2. To retrieve the value of a specific item from a SharePoint list, add the ‘Get item’ flow action. Configure the details like Site Address, List Name, and Id.

Power Automate startsWith() function format

3. To initialize the SharePoint list column, add an Initialize variable flow action and set all the details.

  • Name: Provide the name of variable.
  • Type: Select the variable datatype as String.
  • Value: I have given ‘Title‘ from dynamic content here.
How to use startsWith() function expression in Power Automate

4. Next, add the ‘Compose‘ flow action to set the expression to check whether a given string starts with a certain string.

startsWith(variables('BlogStartsWith'),'Power Automate')
How to use startsWith() function in  Power Automate

5. Now, it’s time to Save and Test -> Then test it Manually. Now add an item to the SharePoint list as like below:

Power Automate starsWith() function expression

6. The compose flow action will display the output according to the startsWith() expression below.

  • The output returned from the Power Automate startsWith() function will give true.
Power Automate startsWith() expression using SharePoint List

This is how to use the startsWith() function in Power Automate.

Example:2 [Power Automate startsWith() function by Instant cloud flow]

Let’s see how to use the startsWith() function in Power Automate by creating an Instant cloud flow that gets triggered manually.

Here, I gave the text as [Hello Lidia! Merry Christmas]. If the text begins with [Hello], then output will be [true].

Power Automate startsWith() function

To do this, follow the steps below.

1. Navigate to https://make.powerautomate.com to open the Power Automate home page. Click on + Create -> Select the Instant cloud flow -> Provide the name of the flow and choose your trigger’s flow (Manually trigger the flow) -> Click on Create.

2. Next, add the ‘Initialize variable’ flow action. Configure below parameters:

  • Name: Enter the name for a variable.
  • Type: Select the type of the variable as String.
  • Value: Here, I have given ‘Hello Lidia! Merry Christmas’ as the variable’s value.
Power Automate startsWith() function expression

3. Then, add the ‘Compose’ flow action to give startsWith() expression.

startsWith(variables('StartingText'),'Hello')
How to use startsWith() function format in Power Automate

4. Now, it’s time to Save and Test. Then, test it Manually. The compose flow action will display the output as shown below.

Power Automate startsWith() expression

This is how to use the startsWith() function in Power Automate to check whether a string begins with specific value.

Conclusion

I hope you find this Power Automate tutorial helpful. I have shown topics related to Power Automate startsWith() function along with its syntax.

Also, I have described how to use the startsWith() function with few examples.

Also, you may like some more Power Automate tutorials:

>