Power Automate startswith Function

Do you want to know how to use startswith function in Power Automate? In this Power Automate tutorial, I have explained how to use the Power Automate startswith function and will show you a few examples of Power Automate startswith functions.

The StartsWith function in Power Automate tests whether one text string begins with another string and is case-sensitive. It will return true; if it exists, else it will return false.

Power Automate Startswith() Function

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 performs the same thing for the ending of a string in Power Automate.

Startswith() Function Syntax

The syntax of the Power Automate startswith() function that returns boolean values is like below:

startsWith([string],'value')

Example: startsWith([‘Emma Watson’], ‘Emma’) => Returns value as true.

Power Automate startswith Examples

Let us create an Instant cloud flow that will trigger manually to understand how the startswith() function works in Power Automate.

Follow the below step-by-step process to create a flow.

Example-1:

First, I will explain the startswith() function in Power Automate by building a manual trigger flow.

1. Navigate to https://make.powerautomate.com to open a Power Automate page. Click on “+Create” -> Select “Instant cloud flow”.In the next window, set the flow name, Select “Manually trigger a flow” and click on Create.

  • Click Add an input -> Select Text to provide a string in the trigger.
power automate startswith function

2. Next, add an ” Initialize variable” to store the string value during the flow and set the below details.

  • Name: Give a name for an initialized variable
  • Type: Select the datatype from the drop-down.
  • Value: Take text value from the dynamic content.
Power Automate Startswith Function

3. After that, add a ” Compose” flow action to display the results of the startswith() function.

  • Inputs: In the inputs box, give the below expression.
startsWith(variables('Employee Name'),'Alex')
Power Automate startswith() Function

4. Now, the flow is ready. Click on Save to test it. Test the flow Manually.

Power Automate functions StartsWith()

5. The returns of the compose data operation will display the boolean values ‘true or false’ if the text string starts with a specific string.

power automate startswith example

This is how to work with the Power Automate startsWith() function.

Example-2:

Now, I will discuss another example of the Power Automate startsWith() function using a SharePoint list.

Recently, we have been working on a project based on Power Automate string functions; the client is required to check the text column starts with a specified string in a SharePoint list.

To implement it, I have created a SharePoint list named ‘Hazarad Checklist – Workplace’ with column names and data types, as presented in the table below.

Column NameData type
Company NameIt is a single line of text – Title column
DateDate and time column
Work Location with citySingle line of text
power automate sharepoint startswith

Here, in this SharePoint list, we wanted to check whether the list column “Work location with the city” will consist of a specific text string or not.

To implement it in a flow, Let’s create a Power Automate flow that will trigger automatically and use a SharePoint list.

Follow the below steps to implement the StartsWith() function inside a flow.

1. Open a Power Automate home page, click on +Create -> Select “Automated cloud flow” -> Provide flow name, choose a trigger ” When an item is created” -> Click on Create. Set details below in a trigger.

  • Site Address: Select the site name from the drop-down.
  • List Name: Select the list name from the drop-down.
power automate sharepoint startswith

2. In the same way, add an initialize variable to store the values of that column. Provide name, type, and value parameters.

  • Value: Select value as a column name from the dynamic content.
power automate startswith string

3. Similarly, add a “compose” data operation and set the input value as provided in the table below.

startsWith(variables('City'),'New York')
power automate startswith function

4. Once the flow has been ready. Click on Save and Test it Manually.

power automate startswith example

5. Now add an item to the SharePoint list; the outputs of the ‘compose’ flow action will return the boolean values like true or false, as shown below.

  • If the created item satisfies the expression -> Output as true.
How to use Power Automate StartsWith() function

This is how to use startsWith() function in a Power Automate automated cloud flow using a SharePoint list.

Conclusion

From this Power Automate tutorial, I hope you can understand how to use the startswith() function in Power Automate. I have also explained Power Automate startswith examples.

You may also like: