Question

How should I fill the nested json map data into a data field?

  • 2 June 2021
  • 1 reply
  • 400 views

Hi

May i know if i want to fill the nested json map data into a data field. How should i fill it. 

 

Json:

{
  channelId: 'YOUR_WHATSAPP_CHANNEL_ID',
  to: 'RECIPIENT_OF_THE_MESSAGE(PHONE_NUMBER)',
  type: 'hsm',
  content: {
    hsm: {
      namespace: 'YOUR_NAMESPACE_ID',
      templateName: 'YOUR_TEMPLATE_NAME',
      language: {
        policy: 'deterministic',
        code: 'YOUR_LANG_CODE',
      },
      params: [
        { default: 'YOUR_PARAM' }
      ]
    }
  }
}

 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +9

Before answering, just want to confirm a few things:

  1. You are building a Zapier integration for your API (as opposed to configuring a Zap as a user, in the Zapier product)?
  2. Your API expects data in the shape of the JSON example you posted?
  3. You are trying to figure out how to design input fields in your Action to allow your users to map data into that object?

If so, I think the general direction you will want to look at is presenting a “flat” structure to your users as you define your input fields, and then using scripting in your perform function to reshape the data before sending it to your API.