The "Set variable" action and data types
In Power Automate Desktop, you add actions by dragging and dropping them in the GUI, but internally, flows are built in a programming language called Robin.
When you create actions, you often see parameters enclosed in percent signs (%), and you can put expressions, objects, and more inside them.
This article explains the data types you can define with the “Set variable” action.
Define string and number data
Section titled “Define string and number data”First, let’s look at what happens when you enter a value in the “Value” field without enclosing it in percent signs.
In this case, the Numeric value type is assigned automatically if the value contains only digits, and the Text value type is assigned if it contains anything else.
Copy the following code and paste it into the flow designer.
This creates a flow that defines two variables: a string and a number.
SET VarNumber TO 15000SET VarString TO $'''Hello'''When you run the flow and check the flow variables, you can see that they were automatically identified as “Numeric value” and “Text value”, respectively.


Define lists and objects
Section titled “Define lists and objects”Next, let’s look at what happens when you enclose the value in percent signs.
In this case, you can define not only numbers and strings but also lists (arrays) and objects with multiple properties, all with this one action.
Copy the following code and paste it into the flow designer.
This creates a flow that defines two variables: a list and an object.
SET InitializedList TO ['itemA', 'itemB', 'itemC']SET InitializedObject TO { 'prop': 'value', 'array': ['itemA', 'itemB'] }When you run the flow and check the flow variables, you can see that the data types differ from the previous example: they are “List” and “Custom object”, respectively.


You can also define a Boolean variable by entering %True% or %False% in the “Value” field.
Can you define a date type?
Section titled “Can you define a date type?”The short answer is yes.
If you enter d followed by a date in double quotation marks in the “Value” field, such as %d"2022-03-25"%, a date (Datetime) value is assigned. To include the time as well, use the format %d"yyyy-MM-dd HH:mm:ss.ff+zzz"%.
If you want to get the current date and time, use the “Get current date and time” action.