cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to convert array of strings into multible data sources

MaxLaks
Deputy Chef I
Deputy Chef I

Hi, I would believe my questions is pretty simple. But I just can't figure out how to do this. In my payload schema, I retrieve an array of strings. I call it mail_of_signers. So I have an array that contains a lot of email adresses.
I want to add these email adresses individually as a string format, into a field which only accepts one or more strings.

Hope it makes sense, if not I can elaborate.

2 REPLIES 2

Prajwal
Deputy Chef III
Deputy Chef III

Hi @MaxLaks 

Yes, we can do that, if you could able to share the example schema that would be help full. So that I can able give a proper solution for this.

Regards,
Prajwal Prasanna

Prajwal Prasanna

Prajwal
Deputy Chef III
Deputy Chef III

I am assuming that your output is coming as - 

 

{
	"message": [
		"sample@email.com",
		"sample2@email.com",
		"sample3@email.com"
	]
}

 

 

The result you are expecting is - to map to your target field which accepts the multiple email address in the string format.

 

{
	"message": "sample@email.com, sample2@email.com, sample3@email.com"
}

 

for this to achieve: 

Screenshot 2024-04-12 163304.png

=.to_s.gsub(/[\[\]\"]/, "[" => "", "]" => "", "\"" => "")

by using the above formula you can easily convert the array of emails/strings into a single string with the comma separated values and map to the target step. 

If this doesn't solve you problem let me know with the actual schema and the result schema that you are expecting.

Regards,
Prajwal P

Prajwal Prasanna