How To Split These At The Semicolon?

How can I split these into two seperate email addresses somehow using an api workflow on the Thing?

image

I’m assuming this is a list? If so you can try to reference each of them by querying the item number. For example, on two separate workflows, run “Do search: Item #1” & “Do search: Item #2”.

Hope that helps

-James

Good point and sorry about that, it’s not a list actually it is a Text that had to be imported in this format.

You could use the Expression element in the Toolbox plugin and do this…
You may want to tweak it based on whether you have spaces in the data you’ve imported.
It should handle multiple rows returned from you table.

//get data from bubble and pop it into a variable
var string1 = "Search for Imports's Name";

//replace any commas with semi-colons
var string2 = string1.replace(",", ';');

//remove any spaces in the string
var string3 = string2.replace(/\s+/g, '');

//split each item using semi-colon into an array
var array = string3.split(";");

//result
array;

image

Result:
image

1 Like

This looked like it would work perfectly, but i can’t do it from within the workflow itself it seems.

It must be done on the page.

So basically I’m looking for a workflow that does just this, split at the semicolon, format to list, set the list.

Just so I know, why do you specifically need to do it in the workflow?
You can use the Expression C’s value list if you then need to iterate through each email address in an API workflow afterwards.

This topic was automatically closed after 70 days. New replies are no longer allowed.