Use the GetProperties component
Get the values of multiple properties from a JSON object by using the GetProperties component in RPA Desktop Design Studio.
始める前に
Role required: none
このタスクについて
To configure the properties of the GetProperties component, see Properties of the JSON utilities.
手順
- In the Toolbox pane, navigate to General and drag the Variable component to the Design surface.
-
Double-click the variable and enter a code as a variable.
{ "name": "Abel Tutor", "age": 30, "email": "abletutor@example.com", } - In the Toolbox pane, navigate to Utilities > JSON.
- Drag the GetProperties component to the Design surface.
-
Click the component settings icon (
).
-
Click the Add property icon (
).
- Enter a property name.
- オプション:
Repeat the steps to add multiple property names.
A Data In port is added with each property that you add.
- Click OK.
- To configure the input fields, see Configure port properties.
- オプション:
Connect the data and control ports of the GetProperties component to the
corresponding ports of the other components as described in the following
table.
Port type Port name Data type Description Data In JsonObject Object The JSON object from which to extract property values. JSON object to be passed from the previous component.
Serialize the JSON and pass it from the previous component to get properties.
Example of JSON object:{ "name": "Abel Tutor", "age": 30, "email": "abletutor@example.com", "address": { "street": "123 Main St", "city": "New York", "state": "NY", "zip": "10001" }, "phoneNumbers": [ { "type": "home", "number": "555-1234" }, { "type": "work", "number": "555-5678" } ], "isActive": true }Data Out Name of the port is the same as the name of the properties that you added. Object Returns the values of the properties. If no property value is found, the port return an error.
- オプション: To test the component, right-click the component bar and click Run From Here.