$EventData once (sporadicly) works, then empty

Dear All
I’m preparing our new PSU 3.x Environment and trying to migrate as much as possible from our 2.5.x production environment.

So far everything worked almost well. No big issues to be honest which is great.

However now I’m struggling with a very strange issue related to our UDTables and $EventData.

For some reasons when I first load a Dashboard and let’s say I do ad Get-ADUser to fill a UDTable, the table will have the content of my Query and also the $EventData is populated.
However if I refresh the Dashboard, either using F5 or Sync-UDElement on the Table. the table will fill with the content of my query but the $EventData and also $Body are empty!

So you can imagine that nothing else will work because of that since I don’t have the properties to work with each element in the table…

Has anybody else already seen this issue before I open an issue on github? Maybe there’s something special to take into account when migrating from 2.x to 3.x related to that?

I searched everywhere (forums, github, docs) but haven’t found something exactly like that…

Any help is really much appreciated!

Thanks a lot!

Best regards,
Don

Product: PowerShell Universal
Version: 3.2.8

Can you give any sanitized code snippets? I didn’t have the issue when upgrading from 2.x to 3.x.

Hi Jori
Thanks a lot for your answer.
It’s actually quite difficult becase I have a lot of code in there…
In the meantime trying to debug the whole thing by removing section by section I’ve found the issue:
It seems that there is a problem with multiple Dynamic Regions in the same dashboard.

If I have two then this will somehow “break” the functionality of the second one…
Maybe a timing problem related to how long it takes to refresh the content?
However I also tried with an empty UDDynamic so that the loading time is near 0… and the problem happens anyway… So I think there could be a potential issue with multiple dynamic regions.

Has anybody a Dashboard with more than one UDDynamic and working with 3.x where everything works fine?

Thanks a lot!

Here are some pictures to illustrate our config.

When both UDDynamic are present and it works you can see that there are two buttons present. one for unlocking and one for resetting the password. also, when the UDModal opens you have a Card Title and the username is displayed…

Then when you click on “Search” or refresh the website it happens almost everytime that the results table only has the “Reset Password” button (because of my “if, else” statements) and once you click on it you can see that the $EventData is not present anymore because the Card Title is missing as well as the username (see red rectangles).

If I now remove the UDDynamic 1 Region everything works fine. The Query Results Table always shows the results with all $EventData Information and the dashboard works as expected.

As said, I can clearly reproduce this only on 3.x… on 2.x (which is our prod relese) it works without problems…

Hope these screenshots help a little bit more in understanding the issue with the two dynamic regions…

Thanks,
Don

Funnily enough, I think I am seeing something similar with New-UDDynamic… But my case is different…

I think there is some ‘bleeding’ happening with Variables, if that’s even the word for it… Might be quirks of the scopes.

Hi Jori

This is was I thought initially too… But I think it’s not because as soon as I add a New-UDDynamic somewhere else on the same Dashboard the problem appears. So there’s no content yet there or any vairables that could overwrite each other…

Let’s hope that @adam will put some light on this once he finds some time to answer. Surely very busy at the moment with finalizing the upcoming 3.3 release…

In case somebody else is reading this post:
How do you solve it for you if you have a dashboard with multiple reagions that need separate refreshing capability? Is there another (maybe more clean) approacht o do that? The only reason why I’m using the two different UD Dynamics is because I don’t want to reload every time the whole “page” but only the sections that are important for the various functions…

Thanks,
Don

This table issue seems different than the variable scope issue. The event data is passed in as an argument to the render script block for table columns. I would suggest opening an issue for this.

I kind of understand how this is configured but if you could produce a simple dashboard that demonstrates the problem without relying on your SQL data, it would be super helpful.

Hi Adam

Implicitely you’re telling me that you’re not encountering these kind of problems on dashboards with multiple UDDynamics, right?
…and I assume that you’ve created various even very complex dashboards with more than 1 dynamic region…

OK I’ll try to somehow put together an example for you tomorrow so that you can do your debuging.

Best,
Don

Right. We have a increasingly complex dashboard we use for integration tests. The table one for example has a couple dozen tables on a page with numerous dynamics.