# \[Feedback\] NEW Perspective Dashboard

**URL:** <https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300>\
**Category:** Ignition Early Access\
**Created:** [September 16, 2019, 9:12pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300 "2019-09-16T21:12:15Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![wmbrits7](https://avatars.discourse-cdn.com/v4/letter/w/f1d935/32.png) [@wmbrits7](https://forum.inductiveautomation.com/u/wmbrits7)\
**Post date:** [November 26, 2019, 7:07pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/21 "2019-11-26T19:07:45Z")

</div>

Thanks, you gave me an idea. I manage to get it to work.

Made a bi-directional parameter on the widget view that is binded to the textinput text. I then keep a list that of the tagPath of the udt and index of the widget. I can then marry the two lists using the tagPath and then use the Index in the list to write to the title of a specific widget.

---

<div class="post-metadata">

**Author:** ![wmbrits7](https://avatars.discourse-cdn.com/v4/letter/w/f1d935/32.png) [@wmbrits7](https://forum.inductiveautomation.com/u/wmbrits7)\
**Post date:** [November 27, 2019, 8:22am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/22 "2019-11-27T08:22:24Z")

</div>

I am having issues saving the widget properties json array to the DB. Do you have some sample code on how you manage to do the convert the array/list to a string and the other way around.

---

<div class="post-metadata">

**Author:** ![tordvd](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tordvd/32/11525_2.png) [@tordvd](https://forum.inductiveautomation.com/u/tordvd)\
**Post date:** [November 27, 2019, 11:22am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/23 "2019-11-27T11:22:14Z")

</div>

at the moment there is no straight forward way to do this, as i understood it.  
I asked the same question as you, See this post:

> [@Perspective properties export/import to/from database](http://forum.inductiveautomation.com/t/perspective-properties-export-import-to-from-database/29836):
>
> Anyone knows how to get the json from the props tree of a view by scripting? If i right click and click “Copy”, then paste into a text editor. I get the JSON properly. But how can I do this with a script? Further, given that i have the JSON stored in a DB, any tips on how to replace the exisitng view props?

---

<div class="post-metadata">

**Author:** ![tordvd](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/tordvd/32/11525_2.png) [@tordvd](https://forum.inductiveautomation.com/u/tordvd)\
**Post date:** [November 27, 2019, 11:25am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/24 "2019-11-27T11:25:14Z")

</div>

I like how you got it to work. I have also been asking myself how to implement this.

I do wish that header each widget will be bound to a widget parameter like the “configuring” tag. Anything else feels like a quickfix.

Developers please 🙂

---

<div class="post-metadata">

**Author:** ![grietveld](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/grietveld/32/6984_2.png) [@grietveld](https://forum.inductiveautomation.com/u/grietveld)\
**Post date:** [November 27, 2019, 12:10pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/25 "2019-11-27T12:10:46Z")

</div>

Its fairly simple to do once you can convert the wrapper objects. Below is the majority of my code to accomplish this. Your path to the dashboard might change, but save jsonObjectFull to a table and then I use a non-polling query binding on the property to pull it back on load. So far it seems to work fine.

```auto
   	from com.inductiveautomation.ignition.common import TypeUtilities
    User = self.session.props.auth.user.userName
	layoutFull = self.parent.parent.getChild("BreakpointContainer").getChild("Dashboard").props.widgets
	jsonObjectFull = TypeUtilities.pyToGson(layoutFull)

```

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [November 28, 2019, 6:39am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/26 "2019-11-28T06:39:49Z")

</div>

Or it can be directly editable when the widget goes into configuration mode?

---

<div class="post-metadata">

**Author:** ![reese.tyson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/reese.tyson/32/41674_2.png) [@reese.tyson](https://forum.inductiveautomation.com/u/reese.tyson)\
**Post date:** [January 17, 2020, 6:12pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/27 "2020-01-17T18:12:59Z")

</div>

Absolutely love this feature and the possibilities that come with it! I do have a feature request. While I do like the auto-rearrange feature when adding and moving widgets, it can be very frustrating at times. When trying to get a layout just right, the auto-rearrange feature continues to ‘undo’ the layout that I am trying to create. I have tried making the widgets different sizes and arranging the widgets in a different order but it always seem to “fill” to the top of the dashboard when dragging the widgets around. Maybe next to the edit and delete icons there could be a lock icon that toggles the ability to move the widget.

---

<div class="post-metadata">

**Author:** ![yoni.peleg](https://avatars.discourse-cdn.com/v4/letter/y/c57346/32.png) [@yoni.peleg](https://forum.inductiveautomation.com/u/yoni.peleg)\
**Post date:** [January 30, 2020, 2:58pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/28 "2020-01-30T14:58:17Z")

</div>

Hi,  
So I seem to be having trouble ‘marrying’ viewParams to a specific widget.

I created an iframe View where a user can input into a text field a url, and I made this view an availableWidget.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/579daf546e5019be7063b4e7f869aa067b3a9d12.png)

I added two viewParams to the availbaleWidget: configuring and src. I want the src to populate once a user enters the url. I tried doing this by binding the src entered in the View text field to a global View parameter I called src, which should automatically populate the widget because it has the same parameter name. However, it doesn’t physically populate it (I can’t see any change to the src parameter in the widget). I DO however see the url in the iframe, so there is some sort of connection being made.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/1/1e78f740bb7a7c558a09ac2066ba1c6aea2be22b.png)

Even more strange is what happens when I try to delete the widgets. If I add widget A with src a and then widget B with src b, and then I try to delete widget A, what happens is that src b gets populated with src a due to some indexing issue.

I’ve made a couple attempts to work around this but I am having trouble finding information about this relatively new component. What I need is the ability to find out which widget is currently being edited. How can this be done?

Cheers,

Yoni

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [February 15, 2020, 1:02am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/29 "2020-02-15T01:02:03Z")

</div>

Hi,

Glad you like it. It’s still a little rough and we do have plans to improve it. Specifically the bin packing algorithm that is used to reposition widgets in available space. Currently is does repack to the top left corner, but we are hoping to refine this so that it is more natural to the user. Keep in mind, widgets do not save their new position unless a widget is dropped in a position where one or many widgets might be already placed. It might look like they are getting repositioned while you move a widget, but that is more for feedback to let you know where they might move in case the widget was dropped in its present position. Widgets will return to their original positions if their original position exists.

I hope that helps clarify things.

-Y

---

<div class="post-metadata">

**Author:** ![Bojacobsen](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bojacobsen](https://forum.inductiveautomation.com/u/Bojacobsen)\
**Post date:** [March 8, 2020, 6:17pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/30 "2020-03-08T18:17:53Z")

</div>

Hi.

I still cant save it.

Sorry, but I can’t load the .props.widgets from the database.

Can you guys help me?

@grietveld  
to save i do:

```auto
from com.inductiveautomation.ignition.common import TypeUtilities
	User = self.session.props.auth.user.userName
	layoutFull = self.getSibling("Dashboard").props.widgets
	jsonObjectFull = TypeUtilities.pyToGson(layoutFull)
	#system.perspective.print(jsonObjectFull)
	vars = {"User": User,"JSON": jsonObjectFull}
	system.db.runNamedQuery("Baseline","SaveDashBoard",vars)

```

NamedQuery is:

```auto
REPLACE INTO dashusersetting (
  dashusersetting.user,
  dashusersetting.dashsetting
)
VALUE
( :User, :JSON) 

```

when is try to load query as json to the props.widgets binding :

```auto
SELECT 
  dashusersetting.dashsetting
FROM dashusersetting
where dashusersetting.user = :User

```

it give me this

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f2c95b4d8e856e3bdf394c974c18f6bdedff5ab6.png)

What I am doing wrong ?

---

<div class="post-metadata">

**Author:** ![Bojacobsen](https://avatars.discourse-cdn.com/v4/letter/b/c4cdca/32.png) [@Bojacobsen](https://forum.inductiveautomation.com/u/Bojacobsen)\
**Post date:** [March 8, 2020, 7:56pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/31 "2020-03-08T19:56:05Z")

</div>

I found out

Added transform script to props.widgets binding then it worked

```auto
return system.util.jsonDecode(value)

```

---

<div class="post-metadata">

**Author:** ![Paul.Scott](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul.scott/32/4578_2.png) [@Paul.Scott](https://forum.inductiveautomation.com/u/Paul.Scott)\
**Post date:** [April 2, 2020, 9:43pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/32 "2020-04-02T21:43:47Z")

</div>

Unpinned on April 2, 2020, 9:43pm UTC



---

<div class="post-metadata">

**Author:** ![tony.upton](https://avatars.discourse-cdn.com/v4/letter/t/3da27b/32.png) [@tony.upton](https://forum.inductiveautomation.com/u/tony.upton)\
**Post date:** [October 9, 2020, 9:58pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/35 "2020-10-09T21:58:57Z")

</div>

Please allow us to disable the auto-arrange feature so we can just put widget where we want them. It can be extremely frustrating at times. Its almost impossible to fill the screen the way you want it.

Otherwise, I absolutely love this component. It is my favorite feature in Perspective.

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [October 10, 2020, 7:26am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/36 "2020-10-10T07:26:10Z")

</div>

I just use small size for grid so it is much easier to position widget.

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [October 13, 2020, 6:55am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/37 "2020-10-13T06:55:46Z")

</div>

Hi Tony, I created a request in the feedback, features and ideas here: [https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/dashboard-component-bin-packing-algorithm](https://ideas.inductiveautomation.com/ignition-features-and-ideas/p/dashboard-component-bin-packing-algorithm)

Please upvote to try and move it up the priority list.

I’m testing a workaround today by exposing the position properties of the widget in runtime, allowing the user to manually position the widget without using the drag-and-drop method. Hopefully the algorithm will not effect this.

[Edit]  
Editing the widget’s position property in runtime works well, and doesn’t trigger the bin packing algorithm. It also allows for widgets to overlap [if this is ever needed]. This will be my preferred solution until the algorithm gets optimised.

---

<div class="post-metadata">

**Author:** ![ynejati](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ynejati/32/6093_2.png) [@ynejati](https://forum.inductiveautomation.com/u/ynejati)\
**Post date:** [October 13, 2020, 7:22pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/38 "2020-10-13T19:22:04Z")

</div>

@tony.upton, @matthew.ayre. Sure. Sounds reasonable to me. If that’s what you guys want. We’ll see what we can do. I actually think we might already have it in queue. Thanks for the feedback.

---

<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:** [October 18, 2020, 12:14am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/39 "2020-10-18T00:14:58Z")

</div>

First... Thanks to @Bojacobsen and @grietveld for providing the information they have provided thus far. Without it, I would still be scratching my head. Now to the problem.

I have taken in what has been provided as sample code to save the props.widgets object of a dashboard component to a database table and gotten mostly there. Where I continue to get tripped up is converting the objects to get them stuffed into a table then getting it back to something useful. I would like to share what I have done so far and open up for comment. I feel like I'm making it more complex than it needs to be. I should also point out that I lack some fundamental knowledge about all of the different data types, "wrapping" and "unwrapping", etc. I tend to read trough these forums, do a lot of googling, and hack away.

System Information  
Ignition Maker 8.0.15  
Database: Postgres

**############ My Code ###################**

**## Property Change script tied to props.widgets**

> from com.inductiveautomation.ignition.common import TypeUtilities  
> User = self.session.props.auth.user.userName  
> dashboardWidgets = self.props.widgets  
> jsonObjectFull = str(TypeUtilities.pyToGson(dashboardWidgets))  
> vars = {"user": User,"widgets": jsonObjectFull}  
> system.db.runNamedQuery("DashboardUpdate",vars)

**## DashboardUpdate (Named Query)**

- I have two parameters setup for this named query. :user and :widgets. Both of them are strings.

> INSERT INTO dashboards (dashboardid , username, widgets)  
> VALUES ( DEFAULT, :user , :widgets )  
> ON CONFLICT (username) DO UPDATE SET widgets = EXCLUDED.widgets;

**## I have started a query Binding... (See below)**  
_NOTE: I was testing against user "jtunell" for testing purposes. I would eventually change the parameter value to a script to read active user._

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/3/e31fb73689f8b50e15c0d692a392e30448c970c3.png)

**----- Questions: ------**

1. I had to convert the wrapper object per @grietveld instruction. I then converted that to string because that is the only way I was able to get it passed to the Named Query parameter. I'm able to successfully write it to the database. But... How to undue the str()?? Did I really need to convert to string? I couldnt find another way to pass json to the named query parameter.

2. I see @Bojacobsen added a transform script to the props.widgets binding but this doesnt solve my issue.

3. Looking for pointers on how to come up to speed faster on manipulating the data and the various data types within the Ignition software. I know its a weird question. I not really sure what the right questions is I just know I'm feeling a bit lost.

---

<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:** [October 18, 2020, 12:54am UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/40 "2020-10-18T00:54:22Z")

</div>

Ok… I think I may have stumbled upon the solution! The transform below works. Maybe I just needed to get away from it.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b1577edc4fcb13e9201f21df191fbf5628c6a0d.png)

---

<div class="post-metadata">

**Author:** ![cbarker](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cbarker](https://forum.inductiveautomation.com/u/cbarker)\
**Post date:** [November 4, 2020, 4:15pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/41 "2020-11-04T16:15:36Z")

</div>

Thank you for all of your help (If i could tell the entire chain I would). To anyone that finds this in the future, you need to use the TypeUtilites.pyToGson to do the conversion to JSON, but then you need to use system.util.jsonDecode to get it back. Hopefully they fix jsonEncode soon.

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [November 4, 2020, 5:08pm UTC](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300/42 "2020-11-04T17:08:04Z")

</div>

The JSON issues are supposed to be fixed in 8.1, but I haven’t checked myself yet. I was having a similar issue.

[Previous page](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300.md?page=1)

[Next page](https://forum.inductiveautomation.com/t/feedback-new-perspective-dashboard/28300.md?page=3)
