In this Power Automate Tutorial, we will discuss How to Initialize String Variable in Power Automate.
Also, we will discuss what is Power Automate Initialize String Variable Array, How to work with Power Automate Initialize String Variable empty, and How to initialize variable date in Power Automate.
Also, Read: How to Initialize Array Variable in Power Automate
Power Automate Initialize String Variable
Let us see how to initialize the String Variable in Power Automate with an example.
I had a requirement where I have to display data from the SharePoint list which is of String data type. So here we will initialize String Variable type and then display the data from the SharePoint list in Power Automate.
So here I have created a SharePoint list called EmployeeList shown below consisting of different columns called,
- FirstName(text data type)
- Last Name(Person data type)
- Employee Code (Integer Data type)
- Designation (Choice Data type)

To achieve this follow the below steps:
- Login into the Power Automate flow and then select the + create flow and click on the Automated cloud flow.
- Enter the flow name and choose the trigger as When an item is created or modified and click on the create option as highlighted below:

- Then we will add an action to initialize the variable i.e. initialize the variable.
- Once initialized, we will enter the variable name, choose the string variable type, and add the dynamic content value in the value section.
- Name– Variable Name (VarName)
- Type– Variable Data type (String)
- Value– Add the dynamic content Variable Value (Title, LastName)
Here Title value contains the FirstName value. Because in SharePoint List we have renamed the Title column name as FirstName. So while passing the dynamic content value we have to add the default Site column name called Title and LastName.

We will add a compose action to get the output from the input of the initialized variable which consists of the title value and last name.

- Save the flow and select the Test option and choose Manually and click Test.
- In the SharePoint list, here I have created a new list item as highlighted below so that the Power Automate flow will trigger.

- Once the Power Automate flow has been triggered, we can see the expected output from the SharePoint List as below:

This is how to initialize the String Variable in Power Automate flow with an example.
Check out: How to Initialize Boolean Variable in Power Automate
Power Automate Initialize String Variable Array
Here we will see how to initialize the variable with the string Array type in Power Automate.
In this example, we will initialize the string array to display the first name and last name values in the array format which is of string data type in SharePoint list. For example: If it is of string array then the array looks like [a,b,c..]
Step:1
- Once the Power Automated flow has been created, select an action to initialize the variable with the string data type in an array format as displayed below:
- Enter the name and type of the variable as a string and in the values field add the dynamic content values to get values from the SharePoint List.

After initializing the String variable in an array format, add a compose action to retrieve string values in an array data values from the SharePoint list on Power Automate.

- To run the Power Automate flow, select the Test option and choose Manually and click the Save & Test option.
- Here I will modify the existing SharePoint list item as shown below so that the Power Automate flow will trigger.

- Once the Power automation flow is triggered and runs, we can see the string values in the array format from the SharePoint list in the compose output section as below:

This is how to initialize the variable with the string Array type in Power Automate.
Have a look: What is Initialize Variable in Power Automate
Power Automate Initialize String Variable empty
Let us see how we can initialize String Variable empty in Power Automate,
In this example, we will create an instant cloud flow to manually trigger a flow then we will initialize the variable type string empty.
- Select the + Create flow and click on the Instant cloud flow.
- Enter the flow name and choose the trigger as Manually trigger a flow and click on the create option as displayed below:

- Once the flow has been created, click the + Add step to add action and initialize the variable in the Power Automate flow.
- Then enter the variable name, choose the variable type as String, and the variable as null value as displayed below:

- Now we will add another step to add a compose action to get the output from the initialized input variable value.

- In the compose action input value, we cannot change the value assigned to the variable.
- Save and Test the Power Automate flow and Run flow.
In the below screenshot, we can see that the value is empty and the variable type is a string as expected.

This is how to initialize String Variable empty in Power Automate.
Power Automate initialize variable date
In Power Automate, by default, there is no “date” type to initialize the variable on Power Automate. But we can initialize variables for a date on Power Automate flow.
Here we will initialize a variable and get date values with the string data type and then using compose data operation we will display the date value as output.
To implement this, follow the below steps:
In this example, we will initialize the string data type to display the Start Date, DueDate, and TaskCompletedDate.
- When the Power Automate flow has been created add a trigger and select the SharePoint site address and list name. Here I have selected the Task list below:

- select an action to initialize the variable in a String format as displayed below:
- Enter the name and type of the variable and in the values field add the dynamic content date values.

After initializing the variable, add a compose action to retrieve the date data values from the SharePoint list on Power Automate.

- To run the Power Automate flow, select the Test option and choose Manually and click the Save & Test option.
- Once the Power automation flow is triggered and runs, we can see the date data values from the SharePoint list in the compose output section as below:

This is how we can initialize variables for a date on the Power Automate flow.
Additionally, you may like some more Power Automate and SharePoint articles:
- How to Use Power Automate Delay Action
- How to Use Call To Action Web Part in SharePoint Online
- How to Initialize Float Variable in Power Automate
- How to Initialize Object Variable in Power Automate
- How to Initialize Integer Variable in Power Automate
- Power Automate Get Display Name From Email
In this Power Automate Tutorial, we have learned How to Initialize String Variable in Power Automate. We also covered the below-mentioned topics.
- Power Automate Initialize String Variable Array
- Power Automate Initialize String Variable empty
- Power Automate initialize variable date
Bijay Kumar Sahoo is a highly accomplished professional with over 15 years of experience in the field of SharePoint and related technologies. He has been recognized as a Microsoft MVP (Most Valuable Professional) more than 9 times, starting from April 2014, for his exceptional contributions to the SharePoint community. Bijay is also a prolific author, having written two books on SharePoint – “Microsoft Power Platform – A Deep Dive” and “SharePoint Online Modern Experience Practical Guide“. His deep insights into SharePoint are also shared on his popular YouTube channel EnjoySharePoint where he teaches SharePoint to a global audience (From various countries like the United States of America, Canada, the United Kingdom, Australia, New Zealand, etc). Read more…