This content originally appeared on DEV Community and was authored by Guy Shilo
Hello
In a Colab form, is there away to give a field a dynamic default value ?
For example, I have a field called "project_id" and I want to automatically detect the current project_id and set it as a default value for this field.
I detect the project id and put it into variable "projid":
import google.auth
projid = google.auth.default()[1]
Then I try to use it like this:
project_id = projid # @param {"type":"string"}
But it puts the string "projid" in that firld instead of the value of the projid variable.
Is there a way to make it work ?
Thanks
Guy
This content originally appeared on DEV Community and was authored by Guy Shilo
Guy Shilo | Sciencx (2024-09-19T19:23:46+00:00) Dynamic default value in a form fiels, is it possible ?. Retrieved from https://www.scien.cx/2024/09/19/dynamic-default-value-in-a-form-fiels-is-it-possible/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.