Accessing `current_user` in Preloaded JS

I realize the preloaded JS in an advanced feature, but I would expect to be able to do the same things I would be able to do in other scripts throughout Retool.

My main concern is not being able to access the current_user variable, which I think could be very useful.

Hope you'll take this into consideration.

preload-js

Hi @emozio :wave: Thank you for taking the time to share your feedback and feature request!

I want to quickly confirm that you are right, current_user is not available in either org-level or app-level preloaded JS features. I have added your +1 to our existing feature request about this :bowing_man:

1 Like

Thanks, I'm glad to hear this is being addressed.

By the way, in the meantime I just pass in my current_user object as an argument whenever I use the function, which works but is less elegant, obviously.

Great idea - this is the best workaround I can think of too :slight_smile:

1 Like

Speaking of which, I really feel like the current_user could be shortened by user, and deprecate the former as time goes on. user is probably just as obvious, since the current part is implied, in my opinion.

But now I'm getting to the nitty-gritty here, and I fully realize that :wink: