In my scenario, I want to send an HTTP request to a Microsoft Teams Channel via Webhook.
I create a JSON body as my template message for the Teams Channel.
I want to dynamically set the error message of the module, that failed.
When creating the JSON body template, I do not have access to the error handling route and the specific error message.
Instead of creating the body during each error handling, I would like to refer to the module that was previously executed.
{{errror.message}} provides a null value, as it refers to no information. Only when I fully qualify the variable, e.g. {{1.error.message}} I have the respective error message.
Is there a way to add a placeholder for the “1.”, which will automatically fetch the ID of the previous module?
Other solution my be storing the message or error info in a datastore, regardless of which module it occurs in. Later yo could read the datastore registers and make the job of sending the JSON
Hi Ramon,
thanks for the ideas. I doubt that you can “join” error routes together.
They are specific for the module, which goes into error.
I thought about collecting all errors.
The only way that would be possible is to use the “Resume” directive. Directives for error handling (make.com)
In each error route, I would write the error to an array and add a flow after a router module, which triggers (filter) if the array of errors has elements. I can then send out a message containing all errors.
The problem though is that the scenario will be marked as a success, which is, in my eyes, misleading.
It’s not very nice, but using the function replace in the HTTP module, I can modify the JSON body multiple times.
By replacing the values, I have defined previously, I can thus create the complete body with the required error message. Above the free plan, I can even place the JSON body template as a team variable (string) and reduce the operation to create the JSON body during the scenario.
I just wanted to step in and say congrats on figuring this one out Also, thanks a lot for jumping back into this thread and sharing your final setup for the benefit of the community. Super helpful and much appreciated
FYI: I marked your comment as a solution to keep the community organized and easy to look for answers.
One last remark, If you use system variables in the JSON body, they are only set during the scenario execution.
Should you use a custom variable, those values will not be automatically set.
Your “replace” could at the end look something like the following, which I highly doubt anyone trying to maintain your scenario apart from you will be able to understand.