Hello,
We would like to add a “Dynamic Field” so when a user is using an Action, Zapier will call our API and get the list of fields and display them to the user.
The first part is to call our API to get the documentation for specific instance ${bundle.inputData.eid}
The ${bundle.inputData.eid} is a field the user needs to select when they add the Action.
const options = {
url: `https://api.spotme.com/api/v2/workspace/${bundle.inputData.eid}/documentation/`,
method: 'GET',
headers: {
'Accept': 'application/json'
},
params: {
}
}
The next part is to parse the result (specifically the results under definitions → person → properties) and I’m having trouble with parsing it to the way Zapier is asking for. Can anyone help please?
Result for example:
{“swagger”: “2.0”,
“info” : {}
…
…
“definitions” : {
“person” : {
“properties” :{
“_id” : {“description” : “ID of the user”, “type” : “string”},
“fname” : {“description” : “First Name”, “type” : “string”}
}}}}
Goal is to parse the fields so they can be displayed to the user.:
_id ==> String
fname ==> string