Set
ActionStep Reference » Windows » Network » JSON » Set
The JSON Set ActionStep is designed for modifying JSON content by updating the value of a specified key or path within a JSON structure. This tool is essential for altering data within JSON objects, making it highly useful in data manipulation and API interactions.
- Open the Windows node in the Workspace Explorer.
- Open the Network node.
- In the JSON node, select the Set ActionStep.
Parameters:
The ActionStep has the following input parameters:
name |
Description
|
---|---|
JSON Content
|
The target JSON content.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Key/Path
|
The path or key of the value in JSON content.
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
New Value
|
The new value of the path or key in the JSON content
Allowed Context Scopes [Fixed, Local, Global] Allowed Context Types [Variable, Parameter, Enum] |
Results:
The ActionStep returns the following results:
name
|
description
|
---|---|
Result
|
The updated JSON content.
Allowed Context Scope [Fixed] Allowed Context Types [Variable, Parameter] |
Example 1 (Update key value of a local JSON file):
This example retrieves a JSON file from a directory and derives the key value from its content. The key value named name is then compared to a created local variable named EmployeeName with Text as data type. When the values are the same, another key named status is changed from enabled to disabled. Once set, the content is then stored in a local JSON file and the Result is then output via Message Box.