Showing results for 
Search instead for 
Did you mean: 

Working with CDS Entity Option Set field

This blog shows you how you to work with the CDS Entity Option Set fields for the PowerApps Patch and the Flow Condition to work successfully.
Consider a ticketing PowerApp which is using a CDS entity. The status of the ticket is saved in an Option Set field in the entity. When the ticket is created the status is changed to In-Progress using the patch function and when the ticket is completed an email notification is sent using Flow.
When it comes to working with CDS entity Option Set fields PowerApps and Flow cannot simply use the name of the items in the option set but instead use the value of the item.
As you see below, we have the Status field which is type Option Set. When you click on Edit Option set you will see the four items i.e. New, In-Progress, Pending and Completed. Using these text values in the Flow condition or the PowerApps Patch function will not work. Instead you need to use the value of each option. The value of the New item is 572,090,0000. It is important to know that you need will have to use the numerical values only and remove the commas i.e. ','.
Here's a screenshot of all the numerical values of the four items
Hence in your PowerApps patch function to save the In-Progress item in the Status field will be something like this. When patching the Option Set field give it it's own  brackets i.e. {}
And this is how you add the status value in Flow

This video walks you through how the values are used in the Patch function and the Flow condition used in the demo app. In also shows how another way to get the numerical value from Dynamics 365 settings.
Meet Our Blog Authors
  • PowerApps Community Mentor 2018, Practicing surgeon and former Professor of Surgery, University of Illinois, Chicago.
  • Jill of All Trades (Power Apps, SharePoint, PowerShell, Exchange, Power Automate and odds & ends of assorted other things)
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 12 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • I'm Tim Leung - a PowerApps builder. In addition to PowerApps, my main interests include building software with SQL Server and Microsoft .NET. I'm the author of 'Beginning PowerApps' - the first published book on PowerApps. You can buy this from Amazon and other leading bookstores.
  • Systems developer
  • My name is Timothy Shaw and I create digital solutions using the Power Platform, Office 365, and Azure SQL and handle the IT for a small company in the energy sector. When not building the future :), I enjoy playing guitar, good (or really bad!) sci-fi, Xbox therapy, and hanging with my wife and son. Twitter: @ShortForTim