Aztable update not working in foreach

Hi, i am creating a dashboard that looks up UD cards from seperate ps1 scripts and displays them on the dashboard (there is a good reason for this). If i use:
foreach ($PageUser in $Cache:ObjPageUserActive)
{
New-UDColumn -Content {
$Path = $PageUser.Name + “.ps1”
.(Join-Path “C:\inetpub\wwwroot\Data\PS1” $Path)
}
}
It successfully looks up the card and places it on the dashboard. I then have a checkbox in that card that updates an entry in Aztable which does not work. It says the the property ‘x’ cannot be found in the object.

The strange thing here is if i just call the script without a foreach loop it works fine and checking that box goes away and updates the table:
New-UDColumn -Content {
.(Join-Path $PSScriptRoot “Data\PS1\Setting1.ps1”)
}
Any thoughts?

Well today i have learnt some valuable lessons regarding custom variables in endpoints and the use of $Cache… I missed a $cache setting off my tablerow update script - this is now all working…

1 Like