{"id":924,"date":"2021-07-15T07:58:14","date_gmt":"2021-07-15T05:58:14","guid":{"rendered":"https:\/\/dynamiacs.com\/?p=924"},"modified":"2021-07-15T07:58:59","modified_gmt":"2021-07-15T05:58:59","slug":"filtering-in-cloud-flows-by-enums-from-dynamics-365-fo","status":"publish","type":"post","link":"https:\/\/dynamiacs.com\/?p=924","title":{"rendered":"Filtering in Cloud Flows by Enums from Dynamics 365 FO"},"content":{"rendered":"\n<p>You want to use data from Dynamics 365 Finance and Supply Chain in Power Automate and filter there for so-called values in enums and get stuck?<\/p>\n\n\n\n<p>Then I have a little tip for you.<\/p>\n\n\n\n<p>To get the right name for the enum, I use a &#8220;List Items present in Table&#8221; action:<\/p>\n\n\n\n<p>In this action I set the value for the filter query to the field and the value I want to filter. Here in my example I want to filter the entity SalesOrderHeadersV2 for open orders. The value for open orders is &#8220;Backorder&#8221; and is in the SalesOrderStatus field.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"728\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-1-1024x728.png\" alt=\"\" class=\"wp-image-917\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-1-1024x728.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-1-300x213.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-1-768x546.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-1.png 1327w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>With this filter query, I&#8217;ll just run my Cloud Flow test.<\/p>\n\n\n\n<p>The execution now runs on error because my filter query is not correct.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"557\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-1024x557.png\" alt=\"\" class=\"wp-image-920\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-1024x557.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-300x163.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-768x418.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-1536x836.png 1536w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-2048x1115.png 2048w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-4-1600x871.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>In the Error Details I now find the hint to my error<\/p>\n\n\n\n<p><em>A binary operator with incompatible types was detected. Found operand types \u2018Microsoft.Dynamics.DataEntities.SalesStatus\u2019 and \u2018Edm.String\u2019 for operator kind \u2018Equal\u2019.<\/em><\/p>\n\n\n\n<p>which now brings me the hint to the correct value in the filter query:<\/p>\n\n\n\n<p>My correct filter must be here<\/p>\n\n\n\n<p><em>SalesOrderStatus eq Microsoft.Dynamics.DataEntities.SalesStatus\u2019Backorder\u2019<\/em><\/p>\n\n\n\n<p>because I want to filter on a value from an enum.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"729\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-5-1024x729.png\" alt=\"\" class=\"wp-image-921\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-5-1024x729.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-5-300x213.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-5-768x546.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-5.png 1321w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now I run the flow again and voila, it runs through without error.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"807\" src=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-6-1024x807.png\" alt=\"\" class=\"wp-image-922\" srcset=\"https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-6-1024x807.png 1024w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-6-300x236.png 300w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-6-768x605.png 768w, https:\/\/dynamiacs.com\/wp-content\/uploads\/2021\/07\/image-6.png 1328w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>I hope this helps you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You want to use data from Dynamics 365 Finance and Supply Chain in Power Automate and filter there for so-called values in enums and get stuck? Then I have a little tip for you. To get the right name for the enum, I use a &#8220;List Items present in Table&#8221; action: In this action I&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[8],"tags":[11,188,173],"class_list":["post-924","post","type-post","status-publish","format-standard","hentry","category-blog","tag-dynamics-365","tag-filter","tag-power-automate"],"taxonomy_info":{"category":[{"value":8,"label":"Blog"}],"post_tag":[{"value":11,"label":"Dynamics 365"},{"value":188,"label":"Filter"},{"value":173,"label":"Power Automate"}]},"featured_image_src_large":false,"author_info":{"display_name":"Jan","author_link":"https:\/\/dynamiacs.com\/?author=2"},"comment_info":0,"category_info":[{"term_id":8,"name":"Blog","slug":"blog","term_group":0,"term_taxonomy_id":8,"taxonomy":"category","description":"","parent":0,"count":38,"filter":"raw","cat_ID":8,"category_count":38,"category_description":"","cat_name":"Blog","category_nicename":"blog","category_parent":0}],"tag_info":[{"term_id":11,"name":"Dynamics 365","slug":"dynamics-365","term_group":0,"term_taxonomy_id":11,"taxonomy":"post_tag","description":"","parent":0,"count":14,"filter":"raw"},{"term_id":188,"name":"Filter","slug":"filter","term_group":0,"term_taxonomy_id":188,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":173,"name":"Power Automate","slug":"power-automate","term_group":0,"term_taxonomy_id":173,"taxonomy":"post_tag","description":"","parent":0,"count":6,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/924","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=924"}],"version-history":[{"count":1,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/924\/revisions"}],"predecessor-version":[{"id":925,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=\/wp\/v2\/posts\/924\/revisions\/925"}],"wp:attachment":[{"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=924"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=924"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dynamiacs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=924"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}