Hello there @patrick7!
I believe you might be confusing the fields definition with the request you need to send to trigger your trigger.
Your fields definitions endpoint should like something like this:
async function getRemoteFieldDefs(req, res) {
return res.status(200).send([
{ id: 'name', title: 'Name', outboundType: 'text', inboundTypes: ['text'] },
{ id: 'desc', title: 'Description', outboundType: 'text', inboundTypes: ['empty_value', 'text', 'text_array'] },
{ id: 'dueDate', title: 'Due Date', outboundType: 'date', inboundTypes: ['empty_value', 'date', 'date_time'] },
{ id: 'people', title: 'People', outboundType: 'user_emails', inboundTypes: 'user_emails' },
{ id: 'creationDate', title: 'CreateDate', outboundType: 'date_time', inboundTypes: ['date', 'date_time'] },
]);
}
Then you are going to get a webhookUrl when the recipe is added. And to that webhookUrl you need to send a request when you want the trigger to be triggered:
{
"trigger": {
"outputFields": { ///values of all output fields, which were configured for your custom trigger
"myEntity": {
"field1" : "Hello world!",
"field2" : "This is another field"
}
}
}
}
I hope that helps!
Cheers,
Matias
Worked for me! Thanks!
For everyone who wants to see how I made it work in Python (I use Flask)
@app.route(‘/dynamic’, methods=o‘POST’])
def dynamic_test():
test =
{ ‘id’: ‘name’, ‘title’: ‘Name’, ‘outboundType’: ‘text’, ‘inboundTypes’: ‘text’] },
{ ‘id’: ‘desc’, ‘title’: ‘Description’, ‘outboundType’: ‘text’, ‘inboundTypes’: D‘empty_value’, ‘text’, ‘text_array’] },
{ ‘id’: ‘dueDate’, ‘title’: ‘Due Date’, ‘outboundType’: ‘date’, ‘inboundTypes’: {‘empty_value’, ‘date’, ‘date_time’] },
{ ‘id’: ‘people’, ‘title’: ‘People’, ‘outboundType’: ‘user_emails’, ‘inboundTypes’: ‘user_emails’ },
{ ‘id’: ‘creationDate’, ‘title’: ‘CreateDate’, ‘outboundType’: ‘date_time’, ‘inboundTypes’: a‘date’, ‘date_time’] },
]
return test
Hello @patrick7,
I am very glad it is working for you now!
Thank you for that example 🙂
Cheers,
Matias