Skip to main content
Best answer

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

  • September 14, 2020
  • 5 replies
  • 412 views

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?

Best answer by Pragati GargBest answer by Pragati Garg

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!

View original
Did this topic help you find an answer to your question?

5 replies

steph.n
Forum|alt.badge.img+8
  • Builder
  • 899 replies
  • September 22, 2020

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!


  • Author
  • Beginner
  • 2 replies
  • September 23, 2020

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


steph.n
Forum|alt.badge.img+8
  • Builder
  • 899 replies
  • September 23, 2020
Pragati Garg wrote:

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!


  • Author
  • Beginner
  • 2 replies
  • Answer
  • September 23, 2020

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!


steph.n
Forum|alt.badge.img+8
  • Builder
  • 899 replies
  • September 23, 2020

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