That’s so weird, I have used open_forms thousands of times but I can’t figure out why, after successful authenticaiton.
In this clone demo-app:
https://anvil.works/build#clone:GKRXWEQ6HYNPHKWE=WEWME7GSUZUQSJAHDJEKLJVD
after you log in with your google account, you should be redirected to csv_load form.
Why doesn’t this happen?
Can’t figure out.
And as a separate question, maybe I should open a new post for this, but I see a strange behaviour in APP’s log view.
I mean, different executions of the same APP are listed together like this:
(each row is a separate execution)
and even though it says “8 Entries” I am not given the “Show more results” under the 4 entries shown…
Am I missing something or something strange is going on at Anvil-land today?
Thanks
I’ve not had luck using open_form inside the init method. Try it in the form_show method.
Hi @jshaffstall
uh-oh I never realized that.
30 sec sixth-sense like awakening moment
Is that ever stated in the docs?
I checked in my other apps and actually, unintentionally, the first redirect (the one I am doing in “main” in this example) is always done in some button click event, so it fits your suggestion.
In the redirected form, however, I do again a user check in the init method and redirect again to “sorry” form if user is None, and this works flawlessly.
However, moving all that stuff to the form_show method is painless and effective, so a big thank you!
Here’s a place where this issue is the discussed in the docs: https://anvil.works/docs/client/javascript/html-forms#running-javascript-on-form-startup
But the docs could probably be improved on this point. If you have a thought on where else it should be, people often put requests like that in this thread: Anvil Documentation Suggestions [ON-GOING] - #67 by rickhurlbatt
Here’s a helpful forum post by @stucork: Best Practice to use Form_Show vs Init methods - #3 by stucork
Also, here’s another relevant docs section: https://anvil.works/docs/client/components/forms#how-forms-are-initialised