JSON Parser
Overview
The JSON Parser component in Plinqx is a versatile tool designed to parse and read values from JSON objects. It is capable of handling both simple and complex JSON object structures, making it an essential component for extracting data from JSON strings in various integration scenarios.
Inputs
-
Ignore Error?:
A Boolean value determining whether to continue parsing if an error occurs (True) or not (False).
-
JSON String to Parse:
The JSON string from which you want to extract data.
-
**Field01-20: **Specify up to twenty JSON attributes or fields from which to extract values. Dot notation can be used for nested objects (e.g., person.name) and array indexes (e.g., teamMembers[0].name). To extract an entire array (e.g., teamMembers), convert it to a JSON Collection using the Convert to JSON Collection component for looping through each item.
Outputs
-
Message:
An error message if an error is encountered during parsing.
-
Success:
A Boolean indicating the success (True) or failure (False) of the parsing operation.
-
Value01-20:
The values extracted from the specified JSON fields.
Example Scenario - Customer Information Extraction
Scenario Overview:
A Salesforce org receives customer data in JSON format from an external web form. The JSON includes details such as customer name, address, and a list of recent purchases. The org needs to parse this JSON to create or update customer records and their associated purchase history in Salesforce.
Implementation with JSON Parser Component:
-
Flow Setup for Data Extraction:
- Create a Salesforce flow triggered upon receiving the JSON customer data.
-
Adding JSON Parser Component:
- Incorporate the JSON Parser component into the flow to handle the incoming JSON data.
-
Configuring Inputs:
-
'JSON String to Parse' is set to the received JSON data.
-
Use 'Field01-20' to specify fields like customer.name, customer.address, and purchases for extraction.
-
If purchases is an array, plan to convert it into a JSON Collection for further processing.
-
-
Executing JSON Parsing:
- The flow processes the JSON data, extracting specified fields like customer name, address, and purchase details.
-
Using Extracted Data:
-
Utilize the extracted values to create or update customer records in Salesforce.
-
Convert the purchases array to a JSON Collection and loop through it to update or create related purchase records.
-
Results:
Implementing the JSON Parser component enables the Salesforce org to efficiently extract and utilize data from complex JSON structures. This approach ensures accurate data capture from external sources, streamlining customer data management and enhancing data integration capabilities.