Skip to main content
Best answer

Zapier Formatter: split text

  • January 14, 2023
  • 2 replies
  • 2832 views

Forum|alt.badge.img+1

Hello,

I use a Formatter Split Text action to separate a number from the line item data. The intent is to return the last segment of text. The set up action is below.

 

But the result return 2 identical outputs. How can I return only one output, which is the last segment of the text?

 

Any help would be much appreciated!

Best answer by nicksimardBest answer by nicksimard

Hi @ASAoperations!

Based on the screenshot above it looks like that initial field may be in line item format. Instead of Split Text you’ll want to use this Formatter function instead:

This will give you each of the items as its own field, as well as item_last (which is what it sounds like you were trying to access).

You can see that when I use Split Text the output looks like this:

 

If there is a variable number of items that come through when my Zap runs, I wouldn’t want to always count on my desired text being in item 3 (as shown above).

Can you give Line-Item to Text a try to see if it gets you what you need?

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.

2 replies

nicksimard
Forum|alt.badge.img+11
  • Zapier Staff
  • 2115 replies
  • Answer
  • January 14, 2023

Hi @ASAoperations!

Based on the screenshot above it looks like that initial field may be in line item format. Instead of Split Text you’ll want to use this Formatter function instead:

This will give you each of the items as its own field, as well as item_last (which is what it sounds like you were trying to access).

You can see that when I use Split Text the output looks like this:

 

If there is a variable number of items that come through when my Zap runs, I wouldn’t want to always count on my desired text being in item 3 (as shown above).

Can you give Line-Item to Text a try to see if it gets you what you need?


Forum|alt.badge.img+1
  • Author
  • Beginner
  • 24 replies
  • January 14, 2023

Hi @nicksimard 

 

Thanks so much for the tips. A bit of a tweak and now I’m able to extract the data I need.

What I’ve done was:

Formatter Utilities function to transform in line item to text:

Add a Formatter Split Text to get the last segment of text: