Get Option Set value based on label in Microsoft Flow

Introduction
In this article, we will discuss how we can get option set value in Microsoft flow using string map entity.
Requirement
Let’s say we need to process one import file which will be available in one drive for business and we want to get option set value of relationship type label available in RelationshipType column.
flow2
Solution
In my earlier article, we discussed how we can use string map entity to get option set label based on it’s value using Web API. We can also use string map entity to get option set value based on its label. We can use the following steps
1. Navigate to Flow from your office 365 or from Dynamics 365 apps menu and click on Create from blank.
2. We will be using One drive for Business trigger- when a file is created, so select one drive for Business and select create file trigger like following
flow3
3. Click on the File picker and select root folder, where we will be uploading the file.
flow4
4. Now let’s create a variable where we will store returned value. Click on + New Step and select Add an action.
5. Write Variable under the search text field and select Variables. After that select initialize variable action.
flow5
6. Let’s name this variable as relationshiptype
flow6
7. Now we need to use Get Rows action from Excel, so Click on + New Step and select Add an action. Type Get Rows under text field and select Get Rows action
flow7
8. Set Get rows action details like following, here HIMBAP is the name of the table in excel import file.
flow8
9. Now add Apply to each to process records from excel file
flow9
and configure it like following
flow10
10. Click on + New Step and select Add an action. Type Dynamics 365 and select List records action, we need to configure it like following
flow12
Here relationship type is name of the column in the excel file.

11. Now finally we can add Apply to each step for List records to parse result and assign the result to our variable like following
flow13

Now our flow is ready for the test, when we will upload our excel file to one drive for business our flow will run and we can see output returned like below
flow14

Stay tuned for more Dynamics 365 contents !!

3 thoughts on “Get Option Set value based on label in Microsoft Flow

  1. Pingback: Get Option Set value based on label in Microsoft Flow - Microsoft Dynamics CRM Community

Leave a Reply

Your email address will not be published. Required fields are marked *