Skip to content

Instantly share code, notes, and snippets.

@mike-solomon
Last active September 20, 2019 22:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-solomon/636f270db537567d2b63c82d04224bf7 to your computer and use it in GitHub Desktop.
Save mike-solomon/636f270db537567d2b63c82d04224bf7 to your computer and use it in GitHub Desktop.
sampleField
// Trigger / action code here
const methodNameToAddFieldBasedOnAbove = async (z, bundle) => {
// projectOnEachLine would be whatever the value is for that entry in
// the project dropdown
if (bundle.inputData.specificKeyYouCareAbout !== projectOnEachLine) {
// Return an empty array to not display the field
return [];
}
// Do some call here or return some field with all the standard
// inputField keys / values. This is where you'd add your line
// project field.
return { ... }
}
module.exports = {
// Key / noun / display stuff here
operation: {
inputFields: [
{
// key / label / etc here
key: 'specificKeyYouCareAbout',
// This tells Zapier that whenever this field is updated we
// should refresh the other fields. The method below will
// get the updated field information and be executed again.
altersDynamicFields: true,
},
methodNameToAddFieldBasedOnAbove,
],
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment