Pre-populate deploy button variables via query string

I was speaking with @philhawksworth over on Twitter about a handy little Netlify trick for deploy buttons.

It would be super useful if along with the repo name, you could specify additional query string params for the field values to be used on the deploy form.

There are cases where you have access to the values (for instance, imagine you’re logged into a Dashboard and have a list of deploy buttons, where one of the fields was the current users ID, name or API key)

If this is currently possible, someone please let me know :rocket: and if not, please consider this request :kissing_heart:

I think this is only even close to possible today with the deploy to netlify button. Then I believe that you’re limited to what is set in the toml file, so that isn’t really super close to what you were asking for.

Were I to file a feature request for us, would you be open to doing it via the deploy button noting that you have to configure it using netlify.toml, or do you have some other proposal I should try to capture instead?

Essentially all the feature request would be asking for is the ability to pass down the query string to the form on the page.

I’m surprised this isn’t baked into any of your forms already, useful for login or reset password forms when you already know the email ahead of time and want to pre-populate the form. The same applies to the deploy screen, as it’s separate from the .toml file.

Oh, sorry, that sounds like something very different! You can of course implement the javascript to do this on the client side - take query strings and autofill fields when you render your form, and then when you submit those values will be either used as-is or as the user has edited. We can’t easily do it ourselves automagically since there are infinite ways to draw a form and it would be impossible to cover all use cases.

I thought you were talking about specifically creating a new site on Netlify which we don’t have fantastic support beyond the deploy button for templating right now.

Sorry, I must be confusing matters by explaining it further.

I indeed do mean the deploy button page as shown in my screenshot.

https://app.netlify.com/start/deploy?repository=https://github.com/netlify/netlify-statuskit

If I were able to provide the form values in the querystring of the above link to populate this form, that would be gold:

great, thanks! I’ve filed a feature request to enable that and we’ll follow up in this thread if we do.