How can I filter a JSON dataset and assign the specified returned object to a variable in Python?
Dataset:
{
id : 121
email : email1@email.com
firstName : Jason
lastName : Wright
accountStatus : active
},
{
id : 122
email : email2@email.com
firstName : Carl
lastName : John
accountStatus : active
},
{
id : 123
email : email3@email.com
firstName : Ernie
lastName : Smith
accountStatus : active
}
PowerShell Example if the above dataset above set to the variable $Data
:
$User = $Data | Where-Object {$_.id -eq "123"}
This would return:
id : 123
email : email3@email.com
firstName : Ernie
lastName : Smith
accountStatus : active
How can I store that data in a variable for later reuse?