Hi everyone,
I have a scenario that goes like this :
- Webflow Form Submission
- Router
- Set Variable
- Create Record in my CRM
- Send an Email internally through Brevo Send Email integration
In the form, people have a multiselect where they can choose the type of equipment they own.
The Set Variable module handles that. And the ouput can look like below
[
{
"type_installation": [
"PAC A/E",
null,
null
]
}
]
or
[
{
"type_installation": [
"PAC A/E",
null,
"PV"
]
}
]
Now, in the subject and the body of my email I send the following:
āType of equipment : {{10.type_equipment}}ā ā> This is the Set Variable module.
The issue is that if the prospect selects only one service, I will receive
āType of equipment : , , PVā
or
āType of equipment : "PAC A/E, ,
I tried some join / map / replace / trim, but I never make it workā¦
I would appreciate your help to make it work 
Cheers
Hey @Quentin_h33,
Use this formula to clean up the value:
{{trim(replace(10.type_equipment; ā,ā; āā))}}
Let me know if you need further clarification!
If this helps, kindly mark it as a solution 
Hello @Probotic_Solutions ,
thanks for your help.
I tried your solution (just adapted it to my scenario): {{trim(replace(4.type_installation; ā,ā; āā))}}
But when I paste it, it looks like this:

If I try to update it to make it āworkā, then it doesnāt change anything 



Any idea?
Hi @Quentin_h33,
Apologies for the misunderstanding. Itās a multiselect field where the user can select one or more options, including all. So, we just need to remove the empty elements from the array.
I tested it, and the following formula worked well:
{{remove(15.contacts; emptystring)}}
OR
{{remove(4.type_installation; emptystring)}}
Let me know how it goes. If this helps, please consider marking it as a solution. 
Hello,
Thanks again for your help but it doesnāt seem to work.
ANy idea?
I was sure it would be simple but somehow I donāt manage to have it rightā¦
Hey Quentin,
what does the incoming data literary look like? Can you paste the output bundle form the module here?
I tested with the JSON strings from your initial post and this works:
{{remove(1.type_installation; null; emptystring)}}
Basically use the remove() function on the incoming array and have it delete any values that are either null or empty strings.
2 Likes
Hello,
Thanks for your help, it worked!! I am a ābitā perfectionist so you canāt imagine how happy I am thanks to you.
For your info
Here is the global scenario :
On the module āSet Variableā
Input :
[
{
ānameā: ātype_installationā,
āscopeā: āroundtripā,
āvalueā: [
null,
āClimatisationā,
null,
āGazā,
null,
null,
āPlomberieā,
null
]
}
]
Output :
[
{
ātype_installationā: [
null,
āClimatisationā,
null,
āGazā,
null,
null,
āPlomberieā,
null
]
}
]
Here is the module content
{{add(emptyarray; if(1.data.pac = ātrueā; āPAC A/Eā; ); if(1.data.clim = ātrueā; āClimatisationā; ); if(1.data.pv = ātrueā; āPVā; ); if(1.data.gaz = ātrueā; āGazā; ); if(1.data.fioul = ātrueā; āFioulā; ); if(1.data.domestic_hot_water = ātrueā; āECSā; ); if(1.data.bathroom = ātrueā; āPlomberieā; ); if(1.data.plumbing = ātrueā; āPlomberieā; ))}}
Thanks again!
1 Like