Error with Parameter.Set Value (Orchid)

Hello, I am attempting to write a script that updates family parameter values from mixed case to upper case. I believe I nearly have it working but I am getting an error I don’t understand with Parameter.SetValue.

Warning: Parameter.SetValue operation failed.
Looks up a localized string similar to Number of items does not match the number of keys.

I replaced the value input for Parameter.SetValue to a static “Fred” and the error goes away so the problem clearly revolves around the value input.

Hints anyone? Thanks!

Does anything change if you use level for list in value input/or try changing lacing in parameter.SetValue?

Okay, thank you. I added a list flatten ahead of parameter.setvalue and the error goes away!
I’m not sure if it will work when I run the script against multiple files but this is huge progress. I appreciate the hint!

If anyone can tell me why flattening the list solves the problem I’d like to understand it.

Now that this works I’d like to improve it so that it attacks multiple parameters. This can be done by paralleling up each .getValue .SetValue block but that is pretty clumsy. I tried changing my parameter name to a list in a code block, e.g. “Description”,Comment" but it seems to only accept the first item. Does anyone have advice on this?

Our end game is to run this script on our entire content library and have about ten parameter values converted from mixed case to upper case.