Notifications
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 717 Most Valuable Professional
Michael E. Gernaey 329 Super User 2025 Season 2
Power Platform 1919 268