New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass parameters to the hidden trigger #22
Comments
I am having the same problem!
Currently I am dynamically creating all possible hidden trigger types ... it works, but it is way too dirty & too much code |
I think the best option here is to create the function manually. The const fetchFrogs = async (customType, z, bundle) => {
const requestOptions = {
url: `${process.env.BASE_URL}/api/frogs/getall`,
params: { type: customType },
};
const response = await z.request(requestOptions);
const data = z.JSON.parse(response.content);
return {
key: "frog",
type: "string",
helpText: "Please define which kind of frog you want to use",
label: "Frog",
choices: data.frogs, // array of objects, see https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#fieldchoicesschema
// ...
};
};
inputFields: [
//...
fetchFrogs.bind(null, "blue frogs"),
]; That @phorwath @semenmiroshnichenko Do you think that'll work for your use case? |
I like the idea, it's simple! Hadn't thought of bind :D Implemented it, work's! Thanks 🙌 🙋♂️ I would prefer the solution with powering of |
In my Platform CLI integration I have 2 public triggers which use same dynamic dropdown element and same hidden trigger behind it.
Now I want to be able to customize the request my hidden trigger produces.
So let say the hidden trigger (behind the dynamic dropdown) produces object list, but for 1st public trigger I want to show only object with type=1, and in 2nd public trigger with type=3.
So I want to see my perform function in the hidden trigger like this:
And in my public trigger:
The text was updated successfully, but these errors were encountered: