Question

Posting Custom Fields to an API that expects key/value pairs

  • 20 January 2022
  • 2 replies
  • 385 views

Userlevel 2
Badge

I have an Action that posts data to my API for my SaaS app. We’ve recently added a Custom Fields feature to our app, in which our users can define the key and field label.

I obviously can’t put the key into the integration because my integration needs to work for all client instances. So looking for advice on the best approach to handle this.

Should I create a Dynamic Field? Seems like I would need a new API endpoint to look up the custom field keys.

Or is their an easier way to do this where my users can map data from the Trigger to custom fields in the zap?


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

2 replies

Userlevel 7
Badge +12

Hi @jeffernst 

I have also seen apps use dictionary inputs to accomplish this though rendering your custom fields dynamically is a significantly better end user experience!

Userlevel 7
Badge +9

What you are describing is ‘custom input fields’, sometimes called ‘dynamic fields’ (but not to be confused with ‘dynamic dropdowns’). They’re used to dynamically fetch and render fields unique to the current user. In the Zapier Platform you’re able to just assign a function to the field and that function is responsible for fetching the metadata for the fields and returning a collection of field objects. 

> Seems like I would need a new API endpoint to look up the custom field keys.

Correct!

 

https://platform.zapier.com/docs/input-designer#how-to-add-dynamic-and-custom-fields

https://zapier.github.io/zapier-platform/#customdynamic-fields

https://zapier.github.io/zapier-platform-schema/build/schema.html#dynamicfieldsschema