# Save and reload widgets based on user

**URL:** <https://forum.inductiveautomation.com/t/save-and-reload-widgets-based-on-user/38637>\
**Category:** Maker\
**Created:** [September 14, 2020, 12:41am UTC](https://forum.inductiveautomation.com/t/save-and-reload-widgets-based-on-user/38637 "2020-09-14T00:41:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.n.tunell](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@john.n.tunell](https://forum.inductiveautomation.com/u/john.n.tunell)\
**Post date:** [September 14, 2020, 12:41am UTC](https://forum.inductiveautomation.com/t/save-and-reload-widgets-based-on-user/38637/1 "2020-09-14T00:41:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zacht](https://avatars.discourse-cdn.com/v4/letter/z/ea5d25/32.png) [@zacht](https://forum.inductiveautomation.com/u/zacht)\
**Post date:** [September 14, 2020, 2:09pm UTC](https://forum.inductiveautomation.com/t/save-and-reload-widgets-based-on-user/38637/2 "2020-09-14T14:09:53Z")

</div>

> [@\[Feedback\] NEW Perspective Dashboard](http://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300):
>
> The Perspective Dashboard component is finally here! Allow your users to add, remove, resize, move, and configure widgets pre-defined by you, the designer, all during runtime. Overview: The dashboard component uses a grid system based off of CSS grid specifications to position and place widgets. As the designer, you control the general layout of the grid by specifying the responsive mode, row and column count, cell size (fixed mode only), corresponding row and column gaps, and the …

They discuss the problem some in this thread.

---

<div class="post-metadata">

**Author:** ![john.n.tunell](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@john.n.tunell](https://forum.inductiveautomation.com/u/john.n.tunell)\
**Post date:** [September 14, 2020, 6:30pm UTC](https://forum.inductiveautomation.com/t/save-and-reload-widgets-based-on-user/38637/3 "2020-09-14T18:30:56Z")

</div>

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