Is there a way to get these two contents in the CLI?
This error is being generated due to TypeScript checking. The Options property can be undefined so you need to account for that. Here are two possible options for you.
This one uses option chaining and the logical operator to set a default value if the property for Options does not exist.
var test: any[] = context.parameters.inputValue.attributes?.Options || [];
The second one allows the variable to be undefined or an array. You will need to make sure to check the variable to make sure it's not undefined before you use it though.
var test: any[] | undefined= context.parameters.inputValue.attributes?.Options;
I encountered an error using this code?
WarrenBelz
85
Most Valuable Professional
Michael E. Gernaey
59
Super User 2025 Season 1
mmbr1606
55
Super User 2025 Season 1