Announcements
Is there a way to get these two contents in the CLI?
I encountered an error using this code?
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;
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 551
WarrenBelz 430 Most Valuable Professional
Valantis 298