Pre-filling fields based on query parameters in the URL

on my website there is a button for users to create a new contribution. By clicking on it the user gets redirected to the strapi admin panel to create a new entry:

As you can see I also add the groupId as a query parameter to the url.
Is it possible that strapi fills in the field groupId with the Id in the url?

1 Like

Ok this is a total hack, but I couldn’t find a “Strapi way” of doing this. In the bootstrap method of src/admin/app.js, you can do something like this:

bootstrap(app) {
    const pathname = window.location.pathname

    if (
      pathname.startsWith('/admin/content-manager/') &&
    ) {
      const params = new URLSearchParams(

      const tests = {}

      for (const [key, value] of params.entries()) {
        const currentInterval = setInterval(function () {
          const element = document.getElementById(key)

          if (element) {
            element.value = value

          if (tests[key] == undefined) {
            tests[key] = 0

          tests[key] = tests[key] + 1

          if (tests[key] >= 20) {
        }, 200)

Although this seems to only work for simple text fields