Best Practice - Check

Hi all,

So i started playing with Universal Dashboard a few months ago and now have (thanks to a couple of forum posts on here!) and working Dashboard for our IT department. It pulls info in and displays it in various different ways.

For those that know what they are doing it’s probably very basic but it’s taken a lot of work.

Now i’ve finished it i’d like a 2nd opinion on my code if anyone would be willing to take a look? I feel like i’ve gone around the houses a bit to do some parts and i also feel like i’ve not used the variables scopes well enough. It is slow to run certain pages.

Would anyone be willing to take a look and give me some best practice guidance?

Thanks in advance

Joe

Hey @JoeKinsey1988 I remember building my first working dashboard, and I re-used the same function inside every endpoint, as I didn’t realise I could just import the function into my dashboard with the new-udenpointinitialisation command, so yeah my dashboard script was huge in lines. I always say to people to upload it to github and post the link…I mean you could copy and paste it into the forum here but do x3 of ` to make it into a script block

If you format two script ``` using three of these one under the other 
 you get a script block
that will keep your formatting

But I am sure if you post it here or github people will chip in with advice. I have also blog that I need to update with more content https://psdevuk.github.io/ud-flix/ but this covers quite a few things to get you using UD.

1 Like

Yeah, if you upload it i would be more then happy to take a look as well!

1 Like

Another good one for performance, if you have ud grids with large datasets, look at -serversideprocessing once you work out how to do it works super quick, let SQL do the hard work, not UD :wink:
The only caveat to that is that the download option will then only download the records that are held in UD at the time (so the single page in your pagination) and not your full dataset, but I can live with that!

If you are interested, more info here: https://docs.universaldashboard.io/components/grids (bottom of the page)

1 Like

Thanks. I’ll look to go through it and scrub out any server, domain names.

Thank you, much appreciated.