Best answer

Dynamic fields (not dropdown!) based on parent dynamic dropdown's field value

  • 8 June 2023
  • 1 reply

Badge +1


Please note that I have been doing search on my use case, and this:

is not my problem.

On my custom app:

I have a set of projects, and each one have a set of custom fields.

From project to project, these fields are differents. One could have [firstname, lasstname, email]. Other one could be [age, name, f_email] etc.


I want to invite the Zap user to select a project => dynamic dropdown, done, works well.

Now, dynamic fields are based upon the id project selected, ie → zappier needs to query some of my API endpoint to know which fields we are talking about. They need to pass the id of the project in the query.

const getProjectContactFields = async (z, bundle) => {
z.console.log('fetching project CL dynamic fields...');
const responsePromise = z.request({
method: 'POST',
url: '',
body: JSON.stringify({
idProject: bundle.inputData.idProject
responsePromise.then(response => {
z.console.log('raw response:',;
z.console.log('project fields: ',;
const inputFields = => ({
key: projectField.Code,
label: projectField.Labels[0].Value,
required: projectField.isRequired,
//Custom metadata for perform script only, may or may not need
isKey: projectField.isKey
return inputFields;
// Code: EMail
// Labels[1]
// Culture: en - US
// Value: EMail
// DataType: Email
// Length: 125
// isRequired: true
// isKey: true
module.exports = {
key: 'contactMergeDynamic',
noun: 'Add or update contact having dynamic fields',
display: {
label: 'Add Or Update Contact, having dynamic fields',
description: 'Add a new contact to your list or Update an existing one. Fields depend on input project'
operation: {
inputFields: [{
key: 'idProject',
label: 'Project identifier',
required: true,
altersDynamicFields: true,
dynamic: 'project.idProject.ProjectName' // special ddl notation: triggerKey.keyFieldName.humanReadableFieldName
perform: contactMergeDynamic,
//sample: sample

 The formatting renders badly on my end so just in case:

So far, I only get the ddl prompt in the zap edit UI, without the fields appearing.


I have trouble linking the function getProjectContactField with its dependent parent idProject. I wonder if this is possible


Best answer by wmarfil 8 June 2023, 21:58

View original

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

Badge +1

Lmao, just a dumb error on my part. was not returning the promise properly. Totally possible therefore.

Anyways I leave the post here as a solution for someone looking to do this pattern if thats cool with you