Define variables with multiple properties
Power Automate Desktop also has many variables actions.
However, there are actions for normal strings, numbers, dates, lists, etc., but there are no actions that define objects with multiple properties.
There is no action that can be used as it is, but by devising a little, it is possible to define variables with multiple properties with just one action.
This time, I will explain the procedure.
How to define variables with multiple properties
This time, we will use "variable setting".
The action has the following parameters.
Parameter name | value |
---|---|
setting | Meaned variable names |
destination | Value stored in variables |
In this "destination", it is possible to describe the code directly in addition to strings and numbers.
By using it, you can define variables with multiple properties by passing object type data directly to the destination.
implemented with copy and paste
This time, as a sample, we have prepared a flow that defines a variable that sets a property with two different data type data on the initial value.
Copy the following code and paste it on the edit screen of Power Automate Desktop to add the target action.
SET InitializedObject TO { 'prop': 'value', 'array': ['itemA', 'itemB'] }
Operate and implement Power Automate Desktop
Enter "Setting Variables" from "Action Search".
Set the parameter as follows
Parameter name value setting %InitializedObject% destination %{ 'prop': 'value', 'array': ['itemA', 'itemB'] }% By running, you can define a list with multiple initial values.
In the same procedure, it is also possible to generate a list with multiple items as initial values.