In this flow tutorial, we will discuss, how to initialize object variable in power automate with an example.
Also, you can read: How to Initialize Integer Variable in Power Automate
What is Initialize Object Variable in Power Automate
In Power Automate, we can use different variable datatypes and one of them is the Object data type.
When we initialize a variable with an object data type, it accepts the values in JSON format. For example, JSON format consists of two parameters called key and value pair.
{"name":"John", "age":30}
Where,
- Key = name, age
- Values = John,30
In the following example, we will see how to initialize an object variable in Power Automate flow.
Example-1
- Recently, I got a requirement to send an email only to the selected users to notify the total sales and profit percentage values.
- And we will achieve this by creating an object variable type and then we will dynamically pass the content values using Power Automate.
How to Initialize Object Variable in Power Automate
- Create an instant cloud flow -> Add the flow name (Power Automate initialize variable object) -> Select the Manually trigger a flow -> Click on the Create option.

- Expand the trigger action, select +Add an input, and then choose the Input type as Number.
- Enter the Input number field Name, here I have added two input number fields called Sales %Value and Profit % Value as highlighted below:

- And then we will add the action “Initialize variable“ action. Later, we will add the Variable name and choose the variable type as an Object.
- Add the dynamic content values for the added sales and profits values in a JSON format.
{
"Sales Percent Value": "38.34",
"Profit Percent Value": "60"
}

Now we will add an compose action to check the output of the initialized variable object.

- To send an email, we will select the send an email action from the list of actions and then add the specific email address to the “To” section.
- Add the email “Subject“, here I have added the subject Sales and Profit Value as my email subject.
- In the Body section, we will add the message you want to send to the selected users.

- And then Test -> Save and run the Power Automate flow and select Run Flow automatically.
- Once the flow has run successfully, we can see it notifies the mentioned recipient. In the output section, we can see the click-to-download option, it redirects to the output values.

- And then we will receive the below email to the mentioned user with the message added in the send email action.

This is how to initialize the variable object in the Power Automate flow.
Check out: How to Check If a Date is Blank in Power Automate?
Example:2
Here we will see how to initialize the variable object type in the Power Automate flow.
- Now we will create a Power Automated flow with the trigger When an item is created or modified as below:

- Then we will choose the action as Initialize variable action from the list of actions. Later, we will enter the Variable name (VarObject) and choose the Type as an Object.
- Add the dynamic content values from the SharePoint list in a JSON format as highlighted below:

- Now select the +new step to add the compose action to see the output value from the initialized variable.

- Select the Flow checker, and fix if the error occurs. Else, Save and Test the Power Automate flow.

- Here we will select and modify the below highlighted SharePoint list item so that the power automate flow will trigger.

- In the below screenshot, you can see the compose action output section displays the data value as expected from the SharePoint list.

- In the same way, we will modify the different SharePoint list items as highlighted below:

- The Screenshot below displays the expected result value in the compose action output section.

This is another example to initialize the variable object type in the Power Automate flow.
Additionally, you may like some more SharePoint and Power Automate tutorials:
- What is Initialize Variable in Power Automate
- How to Initialize Boolean Variable in Power Automate
- How to Initialize Float Variable in Power Automate
- Conditionally Update SharePoint list items using Power Automate
- SharePoint Online List Properties Web part
In this Power Automate tutorial, we have learned what is Power Automate variable object type and how to initialize the variable object in Power Automate with different examples.
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…