Canvas Apps – Auto populate Option Set value in the Canvas App Form

Introduction

Hi Everyone,

Hope you are well and staying safe!
In today\’s #PowerGuideTip30, I will show you how to auto-populate or set value in Option set field in Canvas App.
I have designed a Canvas App for Event Management purposes, where I have added a screen that the Event Organizer uses to create an Event. This screen has an Option Set field called \’Event Status\’ that shows the status of the event.
I don\’t want to allow the Event Organizer to set the Event Status value manually and want to auto-populate its value to \’Submitted\’ instead.



Solution

To auto-populate value in Option Set value or Set value in Option Set value you should use Choices() expression.
  • The Choices function returns a table of the possible values for a lookup column.
  • Use the Choices function to provide a list of choices for your user to select from. This function is commonly used with the Combo box/ Drop Down control in edit forms.
Syntax
Choices( column-reference )
column-reference – Required. A lookup column of a data source or Option Set Field column. Don\’t enclose the column name in double-quotes. The reference must be direct to the column of the data source and not pass through a function or control.
Implementation
Choices(\’Event Status (Events)\’.Submitted)
where \’Event Status (Events)\’ represents the Event Status column of the Event table in Microsoft Dataverse and Submitted is the Option set value that I want to auto-populate.

Note: I want to auto-populate the option set value, hence I have used the Choices(….) expression directly on the items property of Combo box. If you want to set the value on button click then you can use the same expression on onselect property of button control.
Useful Reference
I hope you found this PowerGuideTip helpful. 

Stay tuned for #PowerGuideTip31

Published by arpitpowerguide

My name is Arpit Shrivastava, who is a Microsoft MVP in the Business Applications category. I am a Microsoft Dynamics 365 and Power Platform enthusiast person who is having a passion for researching and learning new things and acquiring immense knowledge. I am providing consistent help, support, and sharing my knowledge through various Social Media Channels along with my Personal Blog, Microsoft Community, conducting online training and attending various 365 Saturday Events worldwide and sharing the best Solutions to the readers helping them achieve their goals and objectives in Customer Relationship Space.

3 thoughts on “Canvas Apps – Auto populate Option Set value in the Canvas App Form

  1. Special thanks to (hackingsetting50@gmail.com) for exposing my cheating husband. Right with me i got a lot of evidences and proofs that shows that my husband is a fuck boy and as well a cheater ranging from his text messages, call logs, whats-app messages, deleted messages and many more, All thanks to (hackingsetting50@gmail.com), if not for him i will never know what has been going on for a long time. Contact him now and thank me later.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: