Issue with Array and Text (replacing separator when some values are empty)

Hi everyone,

I have a scenario that goes like this :

  1. Webflow Form Submission
  2. Router
  3. Set Variable
  4. Create Record in my CRM
  5. 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 :slight_smile:

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 :+1:

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:
Capture d’écran 2025-09-16 à 17.29.52

If I try to update it to make it “work”, then it doesn’t change anything :confused:
Capture d’écran 2025-09-16 à 17.29.30
Capture d’écran 2025-09-16 à 17.34.49
Capture d’écran 2025-09-16 à 17.36.41

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. :+1: