16

How can I dynamically populate a form field in my Colab notebook from a URL query parameter so I can construct preconfigured links to it from another system? I tried adapting Can a Jupyter / IPython notebook take arguments in the URL? but the JS in colab runs in a sandboxed iframe with a referrer policy which removed the path and query from document.referrer.

I would also like to make it as easy as possible for someone following such a link to run the notebook on the data supplied in the form fields. Is it possible to connect and run all automatically on opening a notebook? Is there a way to display a 'Run all' button so the user does not have to hunt for it in the menu?

0

1 Answer 1

2

No, you cannot, but you can set the default values to the form. As the answer shows, the variables' values are the form's default values. Maybe you could create multiple cells with different default values.

Sign up to request clarification or add additional context in comments.

2 Comments

If you add a source for the "you can not" part, I'll give you the 500
If you do a Google search for (example) "colab forms url automatically" this question is at the top of the page currently, and if you scroll down, one of the results is a Github issue/feature request that is closed (from 2021, I know). Plus there is almost nothing about this other than that. :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.