Save and reload widgets based on user

OK… I feel like I’m drinking from a funnel and a bit overwhelmed as I try and solve this one. Hoping its easier than I’m making it.

Problem:
I have a simple dashboard that is two columns and 4 rows. I do not need to dynamically create new dashboards or change any properties (other than widgets) based on user. I do however want to save the widgets selected by the user so they are there the next time that user logs in.

Solution Concepts:
My thought is to save the dashboard components prop.widgets object and associate that with the current user. Maybe in a DB? I am just getting started and I’m very rusty when it comes to scripting in Python and the last time I used SQL was 15 yrs ago. I’m looking for thoughts on how others would do it. I know the app that comes as an example app in Maker has some, if not all, of this in there but it is way more than I can comprehend. I need to dumb it down.

Questions:

  1. Can I write a script that fires on Change for the widgets property? Essentially the script would capture the widgets object, grab the user ID, and then write that to a DB (in my case postgres).
  2. Can I then have a script that fires on login of a user that will query the DB for the user ID and then write the widget object saved to the sessions dashboard?
  3. Is there a simpler way than described above?

Any help is appreciated.

John

1 Like

They discuss the problem some in this thread.

Thanks for pointing me in that direction. You are correct. It appears that thread is discussing a similar problem.

1 Like