I’m building a dashboard to lookup users and wanted a button to click to show the user details in a modal. The issue is sometimes when the table loads the button is not able to get the $EventData.PersonID, even though the previous column is just PersonID. If I refresh the page it typically thene shows, it’s very inconsistent. Is my assumption that the first column showing the personID means that the render should “always” work as well?
Screenshots of the dashboard, showing that in BOTH cases the data is present, just for some reason $($EventData.PersonID) is rendering as Null in the Render section.
$EventData seems to be cleared in the Render, because the if/else is prior to the button handler.
I tried the code you sent with the same results unfortunately.
Trying to determine if there is a racing condition that is causing this, but the fact that the table data all refreshes, it’s just the button that seems to not render. Do the buttons render before the tables? Since the button is defined in the Column deffinition I would expect the table and button to both render at the same time.
Wanted to just follow up and let you all know I have figured this one out.
The issue is if you define Columns as a Variable to pass to New-UDTalbe such as
New-UDTable -Data $Data -dense -ShowSort -DefaultSortDirection ascending -ShowPagination -PaginationLocation both -PageSize 20 -Columns $Columns
The render is in the $Columns Variable
The fix was to NOT use a $Columns variable and to put the columns explicitly in the New-UDTable.
Just to follow up, I was having the same issue although I already had my columns explicitly in the New-UDTable but as soon as I removed the -id from the button it fixed my issue. So maybe its remove the -id and explicitly list the columns. I also didn’t have to store $EventData to another variable. Weird all the way around though