Retrieving OptionSet Labels from CDS data in a Cloud Flow / Power Automate / Flow is an extra step than just picking from the Dynamic Values. Check this post!!
Scenario
While working with data that is either a result of a Dataverse Trigger (on Create/Update) or Action like (Get record, list record), the OptionSet fields from CDS/Dataverse return the Values of the OptionSet instead of the Text Labels –
Let’s say this is the OptionSet in Dynamics
And when you pick the OptionSet field from CDS either from an Action or a Trigger like this Let’s say I’m capturing this in a variable to show you
I’m storing this in a variable for this example to show you
I’ll capture the Value of the OptionSet i.e. the Value part
Result –
What needs to be displayed is the Label of the OptionSet! Let’s see how we can do this –
Triggers
Actions – List records (Inside Loops)
Actions – Get record (Single record)
triggerOutputs() / triggerBody() to read the OptionSet values from Triggers
Let’s see how to read the OptionSet values from CDS Triggers, Create or Update –
When a Flow is triggered using CDS/Dataverse Triggers (I’m using Common Data Service Environment(Current Environment) trigger), you can read the OptionSet value by using triggerOutputs() / triggerBody() function – Here’s a triggerBody() example Now, notice that the name of the field is cf_accounttype. So, the label in Triggers can be retrieved as _cf_accounttype_label and NOT cf_accounttype.
Same way, you can also use triggerBody() function instead as well to yield the same result
items() to read the OptionSet values from Action Step – List Records (Multiple Records)
Let’s look at this example where you are retrieving multiple records using List Records and now, you apply a loop on each of those to read individual records.
Assuming you are using List Records and you loop through the outputs of each of these records
Now, the value is represented by items() function on the Loop that you are in i.e. Apply to each. Hence, the function is items('Apply_to_each')?['cf_accounttype@OData.Community.Display.V1.FormattedValue']
This will show the label of the OptionSet in the results
outputs() to read the OptionSet values from Action Step – Get a record (Single Record)
Similar to items() function, we can use outputs() function to read from the Output’s of the Get a Record Action from Common Data Service (Current Environment)
Get an Account is a ‘Get a record’ Action in CDS/Dataverse Current Environment connector. It’ll only fetch a single record.
Now, let’s look at how outputs() function, similar to items() function used in case of Loops is used. Formula is – outputs('Get_an_Account')?['body/cf_accounttype@OData.Community.Display.V1.FormattedValue'] In the above scenario, I’m reading under body hierarchy for cf_accounttype@OData.Community.Display.V1.FormattedValue
Hope this helps!
Here are some Power Automate / Cloud Flow posts you might find helpful –
If you are lately started creating Flows, you’ll come across some errors which are not precisely directing to what might be the issue but throw an error that says as below –
For Triggers (InvalidWorkflowTriggerName) – Run Action (InvalidWorkflowRunActionName) –
Reasoning
The reason you see these errors are because of Invalid Characters which are in your Flow Trigger Step Names or on the Flow Action Step Names.
Invalid Characters in Trigger Names
Invalid Characters in Action Step Name.
Hence, the Step Names shouldn’t contain the below special characters – < > % & ? /
Note: Trigger/Step Names can’t end with a Full Stop (.). However, if there’s a Full Stop in between, it’ll work
Hope this was helpful!
Here are some more Power Automate posts you might want to check out –
If you are new to creating a Canvas App and you’ve just added a Form and when you try to run and test the same in the browser itself, you don’t see it.
So let’s say you’ve put a form like this
And all you see is this –
So this happens based on the Default Mode and whether the context is passed to the form depending on the type or not.
Default Mode
There are 3 Default Modes for a form and it’s critical which one should be used when –
1. Edit – To be used if you are creating a new record. While using this mode, make sure the Item (from a data source is passed to the Form itself. Else, you’ll see the same error message as above and won’t see a blank form in that case.) The Item property should be pointed to pick .Selected i.e. typically, <GalleryName>.Selected.
Context of a record i.e. a Row should be passed on to this form for Edit mode i.e. an existing row to be passed on to this Form from the preceding Gallery/Table control (or any data source based on your implementation). For example – The context I send to the form looks like this. The last parameter i.e. <GalleryName>.Selected is placed on the select button so that once clicked, it’ll send the record context over to the form so that the form is displaying the selected record (which is picked from Item property in the above screenshot) 2. New – New should be used if the Form you’ve inserted isn’t coming as a result of populating a selected record. But you will enter new values and Submit it the first time. Once New is selected, the form will correctly render for you when you test or run the App once correct Mode is selected (i.e. you don’t intend to pass any context to the Form)
3. View – In this view, fields will not be visible and instead the data will be a result of the selected item from the List/Gallery view it is coming from i.e. a Data Row which will populate this form. This will be a Read-Only view. Another form example where View is selected, fields won’t show up but this form would need Context to be passed to it just like in the New mode.
Hope this quick tip was useful.
Here are some more Dynamics 365 related posts you might want to check
This article is contributed. See the original author and article here.
People in many different roles and at various stages in their careers can all benefit from the two new fundamentals certifications being added to the Microsoft training and certification portfolio: Microsoft Certified: Dynamics 365 Fundamentals Customer Engagement Apps (CRM) and Microsoft Certified: Dynamics 365 Fundamentals Finance and Operations Apps (ERP). With more and more businesses using Microsoft Dynamics 365, and a growing need for people skilled in using it to help take advantage of its potential, the opportunities for people who can demonstrate their skill with certification are also increasing. See if these two new certifications can help you advance your career.
Microsoft Certified: Dynamics 365 Fundamentals Customer Engagement Apps (CRM)
The training for this certification gives you a broad understanding of the customer engagement capabilities of Dynamics 365. It covers the specific capabilities, apps, components, and life cycles of Dynamics 365 Marketing, Sales, Customer Service, Field Service, and Project Operations, and also the features they share, such as common customer engagement features, reporting capabilities, and integration options. Exam MB-910: Dynamics 365 Fundamentals: Customer Engagement apps (CRM), which you must pass to earn this certification, measures skills in these areas. There are no prerequisites for this certification.
Is this certification right for you?
If you want to gain broad exposure to the customer engagement capabilities of Dynamics 365, and you’re familiar with business operations and IT savvy—with either general knowledge or work experience in information technology (IT) and customer relationship management (CRM)—this certification is for you. Acquiring these skills and getting certified to validate them can help you advance, no matter where you are in your career or what your role is. Here are just a few examples of who can benefit from this certification:
IT professionals who want to show a general understanding of the applications they work with
Business stakeholders or people who use Dynamics 365 and want to validate their skills and experience.
Developers who want to highlight their understanding of business operations and CRM.
Student, recent graduates, or people changing careers who want to leverage Dynamics 365 customer engagement capabilities to move to the next level.
Microsoft Certified: Dynamics 365 Fundamentals Finance and Operations Apps (ERP)
The training for this certification covers the capabilities, strategies, and components of these finance and operations areas: Supply Chain Management, Finance, Commerce, Human Resources, Project Operations, and Business Central, along with their shared features, such as reporting capabilities and integration options. Exam-MB-920: Dynamics 365 Fundamentals: Finance and Operations apps (ERP), which you must pass to earn this certification, measures skills in these areas. There are no prerequisites for this certification.
Is this certification for you?
If you’re looking for broad exposure to the enterprise resource planning (ERP) capabilities of Dynamics 365 and a better understanding of how finance and operations apps fit within the Microsoft ecosystem—and how to put them to work in an organization—this certification is for you. People who are familiar with business operations, have a fundamental understanding of financial principles, and are IT savvy—with either general knowledge or work experience in IT and the basics of ERP—are good candidates for this certification.
By earning this fundamentals certification, you will gain the skills to solve ERP problems and you can validate those skills to current or potential employers, helping to open career doors. If one of the following groups describes you, earning this certification can benefit you.
IT professionals who want to highlight their broad understanding of the applications they work with
Technical professionals and business decision makers who are exploring how Dynamics 365 functionality can integrate with apps they’re using.
Business stakeholders and others who use Dynamics 365 and want to learn more.
Developers who want to show a deeper understanding of business operations, finance, and ERP.
Students, recent graduates, and people changing careers who want to leverage Dynamics 365 finance and operations apps to move to the next level.
Exam MB-901 is being retired
The two exams associated with these new certifications, Exam MB-910 and MB-920, are replacing Exam MB-901: Microsoft Dynamics Fundamentals. Exam MB-901 will expire on June 30, 2021. After that date, it will no longer be available for you to take – only MB-910 and MB-920 will be – so if you’re currently preparing for MB-901, make sure you take and pass that exam before June 30, 2021.
Although, you can use Text based controls to represent data as is in a Canvas Power App. So why not go an extra mile to make it look more intuitive.
Scenario
Let’s say there are Accounts and you have some kind of Compliance Ratings on them to represent compliant they are based on certain criteria. Could be a Numeric value or Decimal value. But Rating Control represents only in Numeric i.e. Whole Numbers.
So, for this example, I’m using a Rating field which is of type Whole Number in Dynamics 365 on Account entity.
And the complete Dataset looks like this in Dynamics 365 / Dataverse.
Note: I tried with Decimal but it rounded the values hence, sticking to Whole Number.
Rating Control
Let’s say below is the Gallery and you want to show Ratings in the form of stars instead of traditional numeric values.
Now, let’s use Rating Control below the Names of the Accounts to show the Rating values. Select the first Row once you connect to the Common Data Service i.e. CDS / Dataverse Data Source and select the entity you want to populate it with. In this example, we are using Accounts. So my Gallery is populated with Accounts records. Select the first record and navigate to Insert tab and look for Input controls as shown below
Now, look for Rating control.
Once you select Rating, it’ll appear iteratively since it’ll be applied “For Each” of these records in your Gallery control.
I’ve just rearranged them under the name to make them look proper.
Let’s make it Read Only by changing the behavior, so that the Users don’t accidently touch and set a value during Runtime. Although, this won’t affect the actual data but the representation will be incorrect in that case.
Also, the Max will represent the length of your Rating whereas the Default value are kept to 0 in case the field value is not set at Source. (I think 1 would still be misrepresenting)
Now, I’ll connect this Control to the Data Source’s field i.e. Rating field on the Account entity that represents the Rating value. On the Default, I’m setting ThisItem.Rating where ThisItem represents the Row of the Account i.e. the Account record itself and Rating is the field in Dynamics 365’s Account entity which we saw in the scenario above.
And that’s it. You can Save and Publish your App and Run it.
Rating values
Now that we’ve added the Rating Control, let’s Run our App and see how it represents the data from your Accounts entity.
And the Ratings represent the below data –
Hope this was useful!
Here are some more Canvas Power Apps posts you might want to check –
DrWare.com uses cookies to provide you the best possible experience. Use of this site means you understand and accept our cookie policy. Find out more.
Recent Comments