I have a newsletter tracking app that stores emails from various e-commerce brands.
Whenever we receive a new email, a webhook workflow is triggered, sending me the email subject, brand name, date, email body HTML, and other information through the webhook.
I have a drop-down field called promotion type in the email database which has basically options like (using option sets) % off, $ off, coupon, etc.
Now I want to check if the subject line contains the word % discount, then I want to map the promotion type as % off option, but if it contains coupon then I want to map it as coupon option, and so on.
I am not sure how far in to the process you are. So it is not clear to me whether you have mapped the wweb hook to your app or not yet.
To do that, the process is rather similar to way you map an outbound API call. You can set up a test web hook and then you can map the fields the web hook is sending back to you.
So once you have that, then you can work on the bit you really want to achieve, which is parsing the data.
Are you aware of the contains operator? You can use that to match against text you want to examine.
There are a ton of operators and expressions you can use and you can read more about them here:
Sorry, it looks like I was not able to communicate the question properly.
The webhook is already configured.
If I use a request’s data subject contains certain keywords like “% off,” “% discount,” etc., and the response is positive, I want to map one of the options from the drop-down option set.
Similarly, if the subject contains keywords like “$ off,” “$ discount,” and the response is positive, I want to map a different option from the option set, and so on.
However, I am not getting any option to match keywords and then map the right option from the option set.
I hope I was able to communicate where I am stuck.
So the bit you need to play with is the Get an Option attribute in the drop down in your screenshot. That is your access point to your options sets.
You can then filter against the Option Set you select there using the operators in my link above (e.g. contains) and filter out your option set against your key words.
You will end up with something like - which I used to specify TITLE tags in my app for SEO purposes. In here I am filtering down my SEO option sets according the page that is being viewed.