{"id":3210,"date":"2018-08-19T12:03:54","date_gmt":"2018-08-19T12:03:54","guid":{"rendered":"http:\/\/himbap.com\/blog\/?p=3210"},"modified":"2018-09-03T10:08:18","modified_gmt":"2018-09-03T10:08:18","slug":"get-option-set-value-based-on-label-in-microsoft-flow","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=3210","title":{"rendered":"Get Option Set value based on label in Microsoft Flow"},"content":{"rendered":"<p><strong>Introduction<\/strong><br \/>\nIn this article, we will discuss how we can get option set value in Microsoft flow using string map entity.<br \/>\n<strong>Requirement<\/strong><br \/>\nLet\u2019s 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.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow2.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3212 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow2-300x117.png\" alt=\"flow2\" width=\"300\" height=\"117\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow2-300x117.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow2.png 372w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<strong>Solution<\/strong><br \/>\nIn my earlier article, we discussed how we can use string map entity to get option set label based on it\u2019s value <a href=\"https:\/\/himbap.com\/blog\/?p=3038\">using Web API<\/a>. We can also use string map entity to get option set value based on its label. We can use the following steps<br \/>\n1. Navigate to Flow from your office 365 or from Dynamics 365 apps menu and click on <strong>Create from blank.<\/strong><br \/>\n2. 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<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow3.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3213 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow3-300x229.png\" alt=\"flow3\" width=\"300\" height=\"229\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow3-300x229.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow3.png 525w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n3. Click on the File picker and select root folder, where we will be uploading the file.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow4.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3214 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow4-300x83.png\" alt=\"flow4\" width=\"300\" height=\"83\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow4-300x83.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow4.png 567w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n4. Now let\u2019s create a variable where we will store returned value. Click on <strong>+ New Step and select Add an action<\/strong>.<br \/>\n5. Write <strong>Variable<\/strong> under the search text field and select <strong>Variables<\/strong>. After that select <strong>initialize variable action.<\/strong><br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow5.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3215 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow5-300x290.png\" alt=\"flow5\" width=\"300\" height=\"290\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow5-300x290.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow5.png 516w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n6. Let\u2019s name this variable as relationshiptype<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow6.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3216 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow6-300x85.png\" alt=\"flow6\" width=\"300\" height=\"85\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow6-300x85.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow6.png 542w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n7. Now we need to use <strong>Get Rows<\/strong> action from Excel, so Click on <strong>+ New Step<\/strong> and select <strong>Add an action<\/strong>. Type Get Rows under text field and select Get Rows action<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow7.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3217 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow7-300x212.png\" alt=\"flow7\" width=\"300\" height=\"212\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow7-300x212.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow7.png 531w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n8. Set Get rows action details like following, here <strong>HIMBAP<\/strong> is the name of the table in excel import file.<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow8.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3218 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow8-300x133.png\" alt=\"flow8\" width=\"300\" height=\"133\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow8-300x133.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow8-624x277.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow8.png 824w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n9. Now add Apply to each to process records from excel file<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow9.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3219 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow9-300x86.png\" alt=\"flow9\" width=\"300\" height=\"86\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow9-300x86.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow9.png 454w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\nand configure it like\u00a0following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow10.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3220 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow10-300x85.png\" alt=\"flow10\" width=\"300\" height=\"85\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow10-300x85.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow10-624x177.png 624w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow10.png 634w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n10. Click on <strong>+ New Step\u00a0<\/strong>and select <strong>Add an action<\/strong>. Type Dynamics 365 and select List records action, we need to configure it like following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow12.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3222 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow12-300x151.png\" alt=\"flow12\" width=\"300\" height=\"151\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow12-300x151.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow12.png 546w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><br \/>\n<em>Here relationship type is name of the column in the excel file.<\/em><\/p>\n<p>11. Now finally we can add Apply to each step\u00a0for List records to parse result and assign the result to our variable like following<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow13.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3223 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow13-300x143.png\" alt=\"flow13\" width=\"300\" height=\"143\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow13-300x143.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow13.png 583w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>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<br \/>\n<a href=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow14.png\"><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-3226 aligncenter\" src=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow14-300x229.png\" alt=\"flow14\" width=\"300\" height=\"229\" srcset=\"https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow14-300x229.png 300w, https:\/\/himbap.com\/blog\/wp-content\/uploads\/2018\/08\/flow14.png 540w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Stay tuned for more Dynamics 365 contents !!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this article, we will discuss how we can get option set value in Microsoft flow using string map entity. Requirement Let\u2019s 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. Solution In my earlier&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=3210\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3231,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,402,522,593],"tags":[596,595,597,598,600,601,594,599],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3210"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3210"}],"version-history":[{"count":11,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3210\/revisions"}],"predecessor-version":[{"id":3267,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3210\/revisions\/3267"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/3231"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3210"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3210"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3210"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}