Best answer

Define dynamic input fields of one action from the output of an API Call

  • 14 September 2020
  • 5 replies
  • 396 views

Userlevel 1

I am trying to define dynamic fields of an action with an API call. The output of the code has been defined with the following shcema: https://zapier.github.io/zapier-platform-schema/build/schema.html#fieldschema

For Example: [
    {
      "label": "Middle Name",
      "key": "MiddleName",
      "required": false,
      "type": "STRING"
    }]

I am referencing the input fields like below: 

body: {"records": ...bundle.inputData}

While trying to test the API call using UI or ZAP, I am getting an error: Unable to get a value when looking for "key". Is it empty or missing?

Am I missing some configuration? Is there any other way I can debug this error?

icon

Best answer by Pragati Garg 23 September 2020, 18:10

View original

5 replies

Userlevel 7
Badge +8

Hey @Pragati Garg - Did you ever figure this out? If not, let me know and I’ll ask our team to review your question for further assistance. Thanks!

Userlevel 1

Hey, @steph.n I figured it out. It was a small mistake. Thank you for replying :grinning:

Userlevel 7
Badge +8

Hey, @steph.n I figured it out. It was a small mistake. Thank you for replying :grinning:

 

Would you mind sharing the answer? It would really help others who are probably encountering the same issue. Thank you very much in advance!

Userlevel 1

Sure. 

While pushing the dynamic fields into the array, I mapped the wrong values to the key parameter. So essentially the array that was being created was something like below

[
    {
      "label": "Middle Name",
      "key": undefined,
      "required": false,
      "type": "STRING"
    }]

 

Hence, I was getting the error Unable to get a value when looking for "key". Is it empty or missing?

 

Hope this helps!

Userlevel 7
Badge +8

Awesome! I have marked yours as the best answer @Pragati Garg - Thank you again!

Reply