The form can't retrieve the field "id" from URL parameters

Hello,

The new feature “prefilled variables via URL parameters” is great.

But it can’t retrieve the parameter “id” from a URL. Grist automatically rename any field/column named id in id2.

Exemple here : Grist Form - Grist

It’s annoying ! As many tools use “id” in their parameters.

How can Grist Form access or retrieve the id parameter from the URL ? Any idea or workaround ?

Thank you !

In Grist, id is the name of a built-in special column that holds the row ID of each record. So if you add another column with label “id”, Grist will add a suffix to make it unique. That’s why you are seeing id2.

Can you simply use id2 for the parameter, or pick a different name like ident?

Hi dmitry,
Thank you for your answer.

I would have loved to be able to use a custom id name.

But in our case, the change in code is to heavy to change the parameter id to any other name.

And as you know “id” is often use as a parameter in any tool and user can’t change that in any SaaS they are using. So I was hoping for a workaround inside Grist.

Workaround ideas ?

  • Could I create a form from scratch in Custom Widget Builder and publish it, so it’s publicly available (for anyone not logged in) and in the code I’ll retrieve the id in the URL and then push it in the Grist table in the column id2. Is it viable solution ?
  • Any others ideas ? With a column formula ?

Can you tell me more about the tool you have in mind? What’s the flow? What are the options?

I see another workaround. If you manage a web server, you could have your tool generate a mydomain.com/form?id=MyID link and use URL redirection to redirect the user to mygristinstance.com/form?id2=MyID.

Hello guys,

Thank you for your idea.

I initially didn’t want to use a redirection, but it seems I’ll have to. I was hoping do it natively in Grist.

For example, Brevo manages to use any name as a URL parameter for their landing pages like this:

source : https://help.brevo.com/hc/en-us/articles/4796656936082-Pre-populate-a-form-in-a-landing-page-with-contact-attributes

So with Brevo it works for any name in parameter.

Our use case was to handle newsletter unsubscriptions.
However, the tool we’re using is cut off from the public internet, so users couldn’t access the unsubscribe page directly. That’s why we wanted to use Grist : to collect unsubscribe submissions from our mailing list.

So I’ll either use a redirection or not use Grist for that.

P.S : the redirection trick works, but I’m sure Grist could manage any parameter name in the future