How can I select some text from a String using regex in Workato?
I am currently in the process of writing a connector which executes a HTTP GET request to download a HTML file. Within this HTML file, are some values which I would like to extract for other parts of my recipe. With Workato, will I be able to use regex to extract strings based on their patterns? Would appreciate any help I can get on this issue.
In the attached recipe, I go through the following steps:
Map some HTML data into a datapill, you can either do this using one of our connectors, or in my case (for convenience sake) simply extract some from a webpage on your browser.
Following which, you make use of the scan function in formula mode, inputting your regex code into the function as a parameter like in the image below. Do take note that there is no need to nest the regex code within quotes. Tip: It is recommended that you debug/test out your regex code online at https://regex101.com/ before trying it on Workato. This would reduce the amount of debugging you might need to do later on.
In the attached recipe, I go through the following steps:
Map some HTML data into a datapill, you can either do this using one of our connectors, or in my case (for convenience sake) simply extract some from a webpage on your browser.
Following which, you make use of the scan function in formula mode, inputting your regex code into the function as a parameter like in the image below. Do take note that there is no need to nest the regex code within quotes. Tip: It is recommended that you debug/test out your regex code online at https://regex101.com/ before trying it on Workato. This would reduce the amount of debugging you might need to do later on.
Saul Macht
How can I select some text from a String using regex in Workato?
I am currently in the process of writing a connector which executes a HTTP GET request to download a HTML file. Within this HTML file, are some values which I would like to extract for other parts of my recipe. With Workato, will I be able to use regex to extract strings based on their patterns? Would appreciate any help I can get on this issue.
Hi Saul, Workato supports regex through the 'scan' function, which you can use in your recipe via formula mode. I've created an example recipe at https://www.workato.com/recipes/614744-regex-a-string-using-scan-function#settings to show how this can be done.
In the attached recipe, I go through the following steps:
Following which, you make use of the scan function in formula mode, inputting your regex code into the function as a parameter like in the image below. Do take note that there is no need to nest the regex code within quotes. Tip: It is recommended that you debug/test out your regex code online at https://regex101.com/ before trying it on Workato. This would reduce the amount of debugging you might need to do later on.
Bryan Yap
Hi Saul, Workato supports regex through the 'scan' function, which you can use in your recipe via formula mode. I've created an example recipe at https://www.workato.com/recipes/614744-regex-a-string-using-scan-function#settings to show how this can be done.
In the attached recipe, I go through the following steps:
Following which, you make use of the scan function in formula mode, inputting your regex code into the function as a parameter like in the image below. Do take note that there is no need to nest the regex code within quotes. Tip: It is recommended that you debug/test out your regex code online at https://regex101.com/ before trying it on Workato. This would reduce the amount of debugging you might need to do later on.