How to Split an Array of Strings 🎻

I’d like to return the category in a specific collection if our ID is included in a comma separated list in that collection… I think the formula should look like this but I can’t get past split.

if(contains(split(map({Data:rows};JoinedListID);,);{MY_ID})=true;map({Data:rows};Category;);something else)

Screen Shot 2023-04-01 at 12.31.06 PM

12.col3 is the ID I am trying to match. It comes through Iterator

When I start with Map it works.
Screen Shot 2023-04-01 at 1.04.21 PM

Screen Shot 2023-04-01 at 11.48.09 AM

When I add split my output is empty…
Screen Shot 2023-04-01 at 1.04.51 PM

Screen Shot 2023-04-01 at 11.48.55 AM

Thanks in advance.

Cause, you are trying to split an array, the map will result in an array, not a string. What you can do is, after map function perform a join function using , as operator and then do split.

if(contains(split(join(map({Data:rows};JoinedListID);,);,);{MY_ID})=true;map({Data:rows};Category;);something else)

2 Likes

Ok that solved the first part but how do I lookup the precise category? Currently if there is a match it returns all the categories.

Screen Shot 2023-04-01 at 4.08.05 PM

???
I’m trying to acheive something like this…

Is it possible to wrap the ID in wildcards so it searches for the ID with anything in front of or behind it?

Screen Shot 2023-04-01 at 4.44.05 PM

Ok that solved the first part but how do I lookup the precise category? Currently, if there is a match it returns all the categories.

Yes, Cause you are returning the Category and in the else part.

Is it possible to wrap the ID in wildcards so it searches for the ID with anything in front of or behind it?

Currently, It is not possible to do so using the Map function, Unless someone else has a better solution. The only way, to do it is to use an iterator and then do a compare to filter out the results and pick up the required Category, either in an array aggregator or in the module you want to utilize it.

1 Like

Ok thank you.

I could explain my flow a little better and hopefully get some guidance where to place modules.
Screen Shot 2023-04-01 at 5.23.51 PM

  1. Email containing csv
  2. Get All Rows From External Table
  3. Parse csv from email
  4. Array aggregator for parse csv
  5. iterate through the rows from array aggregator
  6. Look for match in external table. The ID will be located in column JoinedListID in a comma separated list.

For example
If our ID is #7VTAT it should return the single Category ‘Socks’
Screen Shot 2023-04-01 at 12.31.06 PM

I hope this helps.

Are you available for hire? Thanks again.

Thanks for sharing the flow,

Since the map one will not work what you want to do now is use an iterator after the last iterator[5] which iterates through Rows obtained in Step 2.

After that put an array aggregator that will grab the category, and in between the new array iterator and aggregator put a filter, that will check if the JoinedListID contains the CSV List ID. This will save operations plus will result in an array of category matching the ListID, which then in the target module you can just use get(newaggregatorarray;1)

2 Likes