Sure,
Just create an additional conditional sentence (If - then) to control the execution code:
let myTrigger = p1; // p1 is the 1st parameter
if (myTrigger == True) {
var data= await fetch('YOUR_URL', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'YOUR_BearerToken'
},
});
const json = await data.text(); // or data.json();
return json
}
Now, you can create a custom action using the new Wait Action feature to get it:
- Set True to code’s trigger (“myTrigger” as parameter/column)
- Wait 2-3 sec to allow the JS to run
- Set False to code’s trigger to disable next executions
Saludos!