Oct 20, 2023 02:42 AM
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:
@kuovonne FYI I also tried your extension and it worked great for all fields except this one.
Thanks
Solved! Go to Solution.
Oct 23, 2023 07:06 AM
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, '","') & '"')
Oct 20, 2023 05:54 AM
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
Oct 20, 2023 08:01 AM
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} & "\"")
)
)
Oct 20, 2023 09:08 AM
@Sho thank you so much for the help, but it doesn't prefill:
Oct 22, 2023 05:01 PM
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}))
)
)
Oct 23, 2023 01:26 AM
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
Oct 23, 2023 07:06 AM
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, '","') & '"')
Oct 24, 2023 03:36 AM
That was simply amazing. It works perfectly, thank you for taking the time to help, really appreciate it.