Reading data from database and sending to uibuilder

I am developing a dashboard in uibuilder. Some of my data should be stored in the database and read from the database and displayed on the dashboard. I have no problem when storing data (I take the relevant output from uibuilder and save it). My problem is reading the data. I read the data from the database and send it to uibuilder, but I use inject node and it's a bit unusual that I activate inject node first and then see the data in my dashboard!
Actually, I want to completely separate the access of my uibuilder from the NR and the user who uses the uibuilder does not have access to the NR.

You can use the second output of uibuilder node (lowest), to catch the uibuilderCtrl message, check it for "client connect" and use it as a trigger to NR to retrieve data from your database. Non need for the inject node, as the uibuilderCtrl message is sent each time the client gets connected to NR.

1 Like

Yes, you can use that to automate initial delivery of data.

Of course, you can also put a simple button on your UI that sends a message to uibuilder that you use to trigger your db query manually.

Thanks all,
I handled this issue in page reload by window.PerformanceNavigation.TYPE_RELOAD

Deprecated: This feature is no longer recommended

Use the PerformanceNavigationTiming interface instead.

From MDN.

But I don't understand why you would do that anyway, if you want to do something when the client loads the document, simply put it at the start of your index.js script.

But as mentioned, this is not necessary as you can do it from node-red.

1 Like

or - if you use Vue - you can put any code that must run at start into mounted: function () { }

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.