Skip to main content
Version: 1

Write JSON

  • Category

    • Outbound

    • Inbound

    • JSON

    • WRITE

  • Flow Icon

Overview

The Write JSON component in Plinqx is adept at creating and constructing JSON objects for use in both inbound and outbound integration scenarios. This component is ideal for dynamically building JSON strings based on varying data inputs, offering flexibility in handling JSON constructions.

Note: This component can be used in conjunction with text templates with variables and/or text formulas, providing additional versatility in constructing JSON objects.

Inputs

  1. JSON String:

    The base JSON string to which additional attributes and values will be added.

  2. Attributes/Values:

    Provide key-value pairs to be added to the JSON object. These pairs will be incorporated into the provided JSON string, constructing the final JSON object.

Outputs

  1. JSON String:

    The final constructed JSON string, incorporating the provided attributes and values.

Example Scenario - Dynamic API Request Construction

Scenario Overview:

A Salesforce org needs to send customer data to an external analytics service via an API. The data sent varies depending on the customer's interaction history and preferences, requiring dynamic construction of the JSON payload for each API request.

Implementation with Write JSON Component:

  1. Flow Setup for API Request:

    • Create a Salesforce flow that triggers when customer data needs to be sent to the analytics service.
  2. Adding Write JSON Component:

    • Incorporate the Write JSON component into the flow for constructing the JSON payload.
  3. Configuring Inputs:

    • 'JSON String' is initially set to an empty JSON object or a template with basic structure.

    • 'Attributes/Values' are dynamically set based on the customer's data, such as interaction history, preferences, and demographic details.

  4. Constructing JSON Payload:

    • The flow executes the Write JSON component, adding the specified attributes and values to the base JSON string.
  5. Using Constructed JSON:

    • The final 'JSON String' output, now a complete JSON object, is used in the API call to the external analytics service.

Results:

With the implementation of the Write JSON component, the Salesforce org can dynamically construct tailored JSON payloads for each API request. This approach ensures that the analytics service receives comprehensive and customized data, enhancing the accuracy and relevance of the analytics results.