Best answer

Split values to columns in transform - doesn't get recognized in next step


Userlevel 1

Hello!

So I have Data coming in from Apify, where all my values are in one singular field, separated by commas. I need the values to end up in separate columns in my Google Sheets. So I went with what I thought was a fairly straightforward process:

  • I added a Formatter - Text - Split Text Action in between my Apify Trigger & Google Sheets Action.
  • The formatter action looks like this:
  • When running the test action, the results seem to be decent:
  • But then, once I go into the next step, where I’m hoping to see 60 different items in the “Formatter” options when setting my Google Sheets columns, I’m still seeing the same value in the results as in the original Apify result - all of the values next to each other, with commas separating them:

What am I doing wrong here? How can I properly split these values into different fields?

icon

Best answer by Danvers 14 July 2022, 19:37

View original

2 replies

Userlevel 7
Badge +12

Hi @lcseidl!

The data from Apify is coming in as line items, which are kind of like nested information. It doesn’t matter too much what they are in this case, only that it looks like a comma separate list but is actually something different and so you need a different formatter step. 

To set up this action:

  1. For the Formatter ‘Event’ select ‘Utilities’ instead of ‘Text’ 
  2. For the Transform, choose ‘Line-item to text’
  3. Add the information from Apify as the input
  4. You can leave the Separator field blank, or add a character like a comma in there - the output of the step will include each line item separately and each item together in one field, separated by whatever is typed in this field

 

 

I hope that’s clear, let us know how you get on!

Userlevel 1

Wonderful, that did the trick, thanks!

Reply