I have two CSVs I import on load
$Users - Contains UsersNames, UsersID,State
$Assets - Contains PCNumbers, Model, Serial
I have $users loaded into a combobox
Update-ComboBox -ComboBox $comboboxNames $CSV.DisplayName
On SelectedIndexChanged, is there a way I can get the UserID to query the $Assets CSV?
Load data after SelectedIndexChange
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- apowershelluser
- Posts: 194
- Last visit: Fri Mar 22, 2024 4:38 am
Re: Load data after SelectedIndexChange
What have you tried?
You have given no information that can help guess at any possible answer.
When loading a Combobox with objects load the whole object then when an even occurs you will know the exact object and all properties.
No idea what you mean by "query" a CSV. A CSV is a tectfile. Loaded as an object you can filter it on a property of a row.
You have given no information that can help guess at any possible answer.
When loading a Combobox with objects load the whole object then when an even occurs you will know the exact object and all properties.
No idea what you mean by "query" a CSV. A CSV is a tectfile. Loaded as an object you can filter it on a property of a row.
- apowershelluser
- Posts: 194
- Last visit: Fri Mar 22, 2024 4:38 am
Re: Load data after SelectedIndexChange
When you step away and go duh
$Assets | Where-Object { $_.UserID -contains $comboboxNames.SelectedItem.Shortname }
I got it
$Assets | Where-Object { $_.UserID -contains $comboboxNames.SelectedItem.Shortname }
I got it