I’m reading group members from an AD group into a variable and want to load them into a dynamic table and display them. This works so far, but the table always only shows maximum two users, even though there are more. If I output the variable with write-output, all the group members are there, but the table still only shows two. I just don’t understand why.
When I run the app for the first time and read a group that has 3 members, the table displays those 3 members. If I then read a group with fewer members, that’s no problem; they are also displayed. But if you then read a group with more than 3 members, a maximum of 3 members are displayed!
So the size of the table depends on the number of users to be displayed in the first run?! WTF!
So if I select a group that has, say, 50 members when I start the app for the first time, the table will only show a maximum of 50 results for subsequent queries
Nice work finding the issue. I would suggest you read up on the scope variables to understand why you $page:DSV var might contain “old” data from a previous run.
In this case you might need to close down your tab and open a new one to get fresh data.
Thanks for your reply. Yeah, i have to learn a lot of thinks because everything is new to me.
No, the variable doesn’t contain any “old” or “invalid” data.
When I output the variable to the log, it contains exactly the data that should be output. But this data isn’t displayed in the table.
I’ve also built in a small counter that counts the array. It also displays the correct number.
But for some reason, the table is somehow limited to the number of users who are read first.
So if the first group only has 2 members and I then select another group in the select box that has 4 members, only 2 members are displayed in the table - even though the variable/array contains all 4?!
I dont get it! Sitting here for days on such a simple task!
This is not how I imagined it with powershell universal…
If I had to reload the page every time, why would I need a dynamic table? That would be completely insane.
I see what you mean. Using your code I am experiencing the same thing. If I have a 4 users group and change it to a different group with 10 users, It will only show 4 out of the 10 users in the table. So the first choice will always limit the number of rows visible in the table.
I’ve created a simple version here that does not need AD to run. It had the same problem, right until I moved the new the new-dynamic to include the New-UDselection. So that seems to have fixed the problem for me.
Try and move your new-uddynamic to include new-udselection and it should also fix your issue. Give it a shot and let me know the outcome.