Set-UDElement on table errors when data is one item

Product: PowerShell Universal
Version: 2.5.4

I’m new to PowerShell Universal, so forgive any ignorance on the subject. I did not see this mentioned nor saw this listed as an issue.

Using Set-UDElement to update a table with a single item results in an error: e.map is not a function

A browser refresh will properly update the table after receiving the error.

Currently, my work around is use Sync-UDElement when the record count is 1 and Set-UDElement when > 1. Using Set is a much nicer transition as compared to re-rendering using Sync.

Is this a bug or should tables be updated with Sync-UDElement?

At a guess, I’d say the data you have, if it’s a single item it’s probably being presented as a hashtable rather than an expected array. try wrapping it in @($data) and seeing if that clears the error.

I’ve never run into this issue of needing to wrap it as you suggest, but that did the trick. Thank you!