Skip to main content
Question

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

  • June 2, 2021
  • 1 reply
  • 435 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' }
      ]
    }
  }
}

 

 

Did this topic help you find an answer to your question?
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

Forum|alt.badge.img+9
  • Zapier Staff
  • 331 replies
  • June 3, 2021

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.