cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Hanele
Frequent Visitor

Error message: "expected type of Table for Optionset"

Hi, 
I wonder if someone could explain what I´m doing wrong:
I´m developing an embedded app on Dynamics 365 form.
I´m creating a new record in CDS with Patch function. 
One of the field causes a strange error:

Patch(
Notifikace, //the etity name
Defaults(Notifikace),
{
Notifikace:NewGuid,
Kanál: 'Kanál notifikace'.Email,
...
}
where Kanál (in_Channel) is of a Choices type field, 
the Choice/optionset itself 'Kanál notifikace' (in_notificationchannel) is a global optionset/choice
Email is an option from the optionset

I´m getting the following error message:

"The type of this argument ´(in_channel)´ does not match the expected type ´Table´. Found type ´OptionSetValue´."

I´m super confused as it is an optionset field with a global optionset...What table does it want?
Thaks for your help
Hana

2 REPLIES 2
Drrickryp
Super User
Super User

Hi @Hanele 

Shane Young, @Shanescows has a video about using option sets in CDS here.  https://www.youtube.com/watch?v=1L633HIvNGE .  You will find the answer to your question as well as many very helpful tips about how to use option sets in Dataverse. 

Hanele
Frequent Visitor

Hello @Drrickryp ,

thanks for the tip, the video is great,
unfortunatelly it did not answer my question as I think I follow the rules in my Patch function:

Column name (option set type): OptionSetName.Option

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,445)