โ02-22-2024 09:58 AM
In a recipe, there is an error that is being returned in a datapill from an API call.
I want to extract just the error "text".
Here is a snippet of the string that is being returned:
I want to end up with:
Item KL65512 is not valid
Solved! Go to Solution.
โ02-22-2024 10:11 AM
This will work with the snippet provided, but without knowing the rest of the string I can't promise it will always work.
message.scan(/\"ErrorMessage\\\":\\\"(.*?)\\\",/)
I recommend parsing the API response instead, so this comes across as an actual data pill.
โ02-22-2024 10:11 AM
This will work with the snippet provided, but without knowing the rest of the string I can't promise it will always work.
message.scan(/\"ErrorMessage\\\":\\\"(.*?)\\\",/)
I recommend parsing the API response instead, so this comes across as an actual data pill.
โ02-22-2024 10:33 AM
Thank you Gary. The snippet that I provided is unique in the string so I avoided posting the entire string.
I had gotten close to what you are suggesting and both seem to product the desired outcome.
.scan(/ErrorMessage\\\"\:\\\"([^\"]+)\\\"/)
The API response is available in the form of a datapill, but I could not find a way to get just that text without REGEX.
Thank You