cancel
Showing results for 
Search instead for 
Did you mean: 
marven
Nintex Newbie

Strip the [ from email in query list

Jump to solution

Hi.

I am running a query list to pick up an email , it is stored in a collection. I found if i tried using it in an email it failed. Having looked at the collection with log to history it produces [email@blah.com]. The [] are the issue. I found that if i use For each and set the output value to a variable  (person) then it works. However if the field i am looking at in the first place has the option of multiple people then the collection output is [[email@blah.com]]. So the option i used prior does not work as it only strips the first [].

Soooo I then used a "get from collection" creating a new collection that now only has [email@blah.com] which i can use in my For Each.

This works (took me many hours of fiddle) however there is no need for the for each loop beyond stripping the []. There must be an easier way to strip the [] or [[]] from my initial collection. 

I suspect it may be a regular expression but have no idea how.

Help appreciated

\Cy

Labels: (1)
0 Kudos
Reply
6 Replies
v-tmasenko
Nintex Newbie

Re: Strip the [ from email in query list

Jump to solution
Using "Replace Substring In String" twice will remove any number of square brackets.

1) Search for [ and replace with nothing in the same String and Output variable.
2) Search for ] and replace with nothing in the same String and Output variable.

View solution in original post

Reply
Nintex Employee
Nintex Employee

Re: Strip the [ from email in query list

Jump to solution

Hi,

The regular expression would look like this:

[^0-9a-zA-Z\.@]

It looks for any letter, number full stop and @ and ignores them which only leaves [ ] which are replaced with spaces.

regOffice 365.png

0 Kudos
Reply
marven
Nintex Newbie

Re: Strip the [ from email in query list

Jump to solution

Thank you, i tried that and it has given me ["","","","email@blah.com","","",""]

 

 

0 Kudos
Reply
marven
Nintex Newbie

Re: Strip the [ from email in query list

Jump to solution
I wonder if this is due to it being a collection
0 Kudos
Reply
marven
Nintex Newbie

Re: Strip the [ from email in query list

Jump to solution

Thank you. This worked, the (replace substring). I think i would rather replace string as it would be one step meaning I will stay under the limit of steps more often Smiley Happy, however this saves a great deal of faf.

0 Kudos
Reply
Highlighted
v-tmasenko
Nintex Newbie

Re: Strip the [ from email in query list

Jump to solution
You're welcome. Please mark my original response as a solution.
0 Kudos
Reply