Skip to main content

Hi,

I have a multiselect field containing topics. It is a linked field to another table and each topic might contain a comma within its value. I need to prefill a form with that data but I find 
Is it possible or do I have to remove the commas within the field values?

Example of topics:
Agricoltura, Ambiente e Territorio, Calamità Naturali
Politiche per il Lavoro, Formazione Professionale e Servizio Civile
Cultura

Formulas I tried:

This only fills the first topic:

 

CONCATENATE(
IF(
"Prefilling Form Preferenze] view in Contatti] table in base with id 'appYSPQbVoKOqpys7'",
"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & ENCODE_URL_COMPONENT({Temi di Interesse} & "")
)
)

 

If I try to remove the comma+space, it doesn't work for the topics that have that inside them:

 

"&prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & SUBSTITUTE(SUBSTITUTE({Temi di Interesse},", ",",")," ","+" & "")

 

I tried ARRAYJOIN with a delimiter different from the comma, but it always separates using commas no matter what:

ARRAYJOIN({Temi di Interesse} ,";")
=>
"Agricoltura, Ambiente e Territorio, Calamità Naturali", "Politiche per il Lavoro, Formazione Professionale e Servizio Civile", Cultura

 

@kuovonne FYI I also tried your extension and it worked great for all fields except this one.

Thanks

 

This is the URL I get, but it's not prefilling:

https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG?prefill_Temi%20di%20Interesse="Agricoltura,Ambiente+e+Territorio,Calamità+Naturali","Politiche+per+il+Lavoro,Formazione+Professionale+e+Servizio+Civile",Cultura

Hi @stefpist ,

This should work.

CONCATENATE(
IF(
"Prefilling [Form Preferenze] view in [Contatti] table in base with id 'appYSPQbVoKOqpys7'",
"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & ENCODE_URL_COMPONENT("\\"" & {Temi di Interesse} & "\\"")
)
)

Hi @stefpist ,

This should work.

CONCATENATE(
IF(
"Prefilling [Form Preferenze] view in [Contatti] table in base with id 'appYSPQbVoKOqpys7'",
"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & ENCODE_URL_COMPONENT("\\"" & {Temi di Interesse} & "\\"")
)
)

@Sho thank you so much for the help, but it doesn't prefill:


Hmmm, I had no problem with text strings.
If it is a "Link to another table" field, the formula is should be this

CONCATENATE(
IF(
"Prefilling [Form Preferenze] view in [Contatti] table in base with id 'appYSPQbVoKOqpys7'",
"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & ENCODE_URL_COMPONENT(TRIM({Temi di Interesse}))
)
)

 


Hmmm, I had no problem with text strings.
If it is a "Link to another table" field, the formula is should be this

CONCATENATE(
IF(
"Prefilling [Form Preferenze] view in [Contatti] table in base with id 'appYSPQbVoKOqpys7'",
"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG"
),
CONCATENATE(
"?prefill_" & ENCODE_URL_COMPONENT("Temi di Interesse"),
"=" & ENCODE_URL_COMPONENT(TRIM({Temi di Interesse}))
)
)

 


I must be doing something wrong because only the first element prefills.

I made a visible duplicate, if anyone cares to have a look:

https://airtable.com/appDi2t3LL3pIMTmF/shrSlehBKeNGKPmNv

Thanks


Sorry, I didn't assume multiple select.

Add a Rollup field and roll up the primary field for "Temi di Interesse".
The formula is this

"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG?prefill_" &
ENCODE_URL_COMPONENT("Temi di Interesse") & "=" &
ENCODE_URL_COMPONENT('"' & ARRAYJOIN(values, '","') & '"')

 


Sorry, I didn't assume multiple select.

Add a Rollup field and roll up the primary field for "Temi di Interesse".
The formula is this

"https://airtable.com/appYSPQbVoKOqpys7/shrVvuD1tVKS88IiG?prefill_" &
ENCODE_URL_COMPONENT("Temi di Interesse") & "=" &
ENCODE_URL_COMPONENT('"' & ARRAYJOIN(values, '","') & '"')

 


That was simply amazing. It works perfectly, thank you for taking the time to help, really appreciate it.


Reply