Skip to main content
Best answer

How to extract last item from a field using Formatter?


I’m trying to work with a public RSS feed that shows weather data. The RSS feed has 1 field (called “Description”) that shows a bunch of measurements/info. The last item in that field is Water Temperature in °F and °C.


I need to extract just the Water Temperature measurements and pass that along to the next step.

I’m using the Formatter app → Action Event is “Utilities → Transform is “Pick from list” → Operation is “Choose last.” Next step (Insert Data) is to select the “Description” field. So far so good, but the output is, like, 90% of the measurements/info when I only need the last 10%. I don’t see a way for me to specify the last x characters or select the text immediately after the constant title “Water Temperature.”

 

Any ideas on how to proceed?

This is the link to the RSS feed: https://www.ndbc.noaa.gov/data/latest_obs/46254.rss

 

Best answer by a1angelesBest answer by a1angeles

I found my own way to do this, without having to hire someone to write regex code.

Formatter by zapier → Split Text (after the constant “Water Temperature: “)
passes along the exact piece of data I needed.

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

robschmidt
Forum|alt.badge.img+9
  • Zapier Expert
  • 617 replies
  • July 23, 2021

Hi @a1angeles 

For this, I believe you need to use a function called RegEx, which can be found in Zapier by using Formatter> Text> Extract pattern.

Regex code can help you extract any information out of a paragraph. If you are new to RegEx, you may need to hire someone to write a piece of regex code for your case.


  • Author
  • 7 replies
  • Answer
  • July 27, 2021

I found my own way to do this, without having to hire someone to write regex code.

Formatter by zapier → Split Text (after the constant “Water Temperature: “)
passes along the exact piece of data I needed.


SamB
Community Manager
Forum|alt.badge.img+11
  • Community Manager
  • 7510 replies
  • July 28, 2021

Glad you figured this one out and thanks for sharing your solution with us, @a1angeles! :)