Read JSON
This activity retrieves values from a JSON document. There are a variety of ways to define the JSON document.
How does this activity look in the Designer Pane?
- Drag it from the Toolbox Pane and drop it in the Designer Pane.
To configure this activity
Select the activity in the Designer Pane to configure the following property boxes in the Properties Pane.
See the following options:
-
Activity Name
Once added to a workflow definition, the default name of an activity can be changed. Providing a custom name for an activity helps you remember the role it plays.
To name an activity
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Name in the Properties Pane, replace the default name.
Note: Activity names cannot be the same as any other activity name in the workflow, they cannot be the same as the workflow's name, they must be less than 100 characters, they must contain at least one alphanumeric character, they cannot be "Name," and they cannot be the same as the activity's runtime type (which is usually only an issue with custom activities).
-
Activity Description
Use the Activity Description to provide descriptive text to help you remember the role that the activity plays in the workflow. All activities contain a default description that you can modify while constructing your workflow.
To modify an activity description
- Add an activity to your workflow by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- Select the activity in the Designer Pane.
- Under Activity Description in the Properties Pane, replace the default description.
-
JSON Source
Use this property box to specify the JSON document you want to process.
- Add the Read JSON activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- In the JSON Source property box, specify the JSON document you want to process. If the JSON document is retrieved as part of a previous activity in the workflow, specify the desired token.
-
JPath Expression Tokens
Use this property box to configure the activity. Specify the JSON document you want to traverse and a JPath expression for how to traverse the JSON document.
To configure JSON information
- Add the Read JSON activity to your workflow definition by dragging it from the Toolbox Pane and dropping it in the Designer Pane.
- In the Properties property box, click New Token.
- Specify a token name.
- In JPath Expression, manually specify an appropriate JPath expression to traverse the JSON document and select values or click to help you build an JPath expression.
- Choose one of the following options:
- Create a token: Choose between choosing to create a new token
- Update token: or to store the result in an existing token.
- In the If multiple matches are found drop-down option, choose what happens when the specified JPath expression matches multiple nodes in the JSON document.
Note: Click the Click here to test the pattern link, to display the Test Input text box. Paste or type a sample JSON document to see the result of your JPath expression.
Example: The response from an HTTP Web Request activity can be a JSON document that contains an element or attribute with a Laserfiche document ID. A Read JSON activity can retrieve this document ID for use in a later step in the workflow.
Important: The Read JSON activity uses the Goessner JPath implementation .