{"id":682,"date":"2020-08-26T15:37:02","date_gmt":"2020-08-26T14:37:02","guid":{"rendered":"http:\/\/wp.bizoir.dk\/?p=682"},"modified":"2020-10-12T17:06:15","modified_gmt":"2020-10-12T16:06:15","slug":"logic-apps-foreach-and-terminate-actions","status":"publish","type":"post","link":"https:\/\/wp.bizoir.dk\/?p=682","title":{"rendered":"Logic Apps: ForEach and Terminate actions"},"content":{"rendered":"<p>Sometimes the simplest things become hard(er)<\/p>\n<p>Normally it is not a problem terminating the Logic App run by using a Terminate action. But when you are iterating over some kind of list using a &#8220;ForEach&#8221; action, you are suddenly not allowed to use a &#8220;Terminate&#8221; action anymore. And Logic Apps does not provide any other way to stop a Logic App run.<\/p>\n<p><!--more--><\/p>\n<p>But luckily, people has found other ways to make a LogicApps action fail on purpose (where a Terminate is not allowed)<br \/>\n<a href=\"https:\/\/stackoverflow.com\/questions\/49456838\/how-to-throw-an-exception-in-azure-logic-apps\">How to throw an exception in Azure Logic Apps<\/a><\/p>\n<pre>Add a \u201cCompose\u201d action with an illegal int-cast\r\nint(\u2018__ERROR__\u2019)<\/pre>\n<p>or<\/p>\n<pre>Using a \"SetVariable\" action, set an int variable with an illegal string-value\r\nstring(\u2018Exception\u2019)<\/pre>\n<p>BTW, these methods does not make the entire Logic App run fail, it only fails the current iteration of the ForEach action \u2013 the other iterations continue independently<\/p>\n<p><a href=\"https:\/\/www.middleway.eu\/azure-logic-apps-for-each-loop\/\">Discussion<\/a> of the LogicApps \u201cForEach\u201d action<\/p>\n<p>LogicApp error<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/a\/61101945\/42223\" rel=\"nofollow ugc\">https:\/\/stackoverflow.com\/a\/61101945\/42223<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes the simplest things become hard(er) Normally it is not a problem terminating the Logic App run by using a Terminate action. But when you are iterating over some kind of list using a &#8220;ForEach&#8221; action, you are suddenly not allowed to use a &#8220;Terminate&#8221; action anymore. And Logic Apps does not provide any other &hellip; <a href=\"https:\/\/wp.bizoir.dk\/?p=682\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Logic Apps: ForEach and Terminate actions&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[30,36],"class_list":["post-682","post","type-post","status-publish","format-standard","hentry","category-guides","tag-azure","tag-logic-apps"],"_links":{"self":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=682"}],"version-history":[{"count":8,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions"}],"predecessor-version":[{"id":732,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=\/wp\/v2\/posts\/682\/revisions\/732"}],"wp:attachment":[{"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.bizoir.dk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}