{"id":2044,"date":"2021-12-31T06:40:51","date_gmt":"2021-12-31T06:40:51","guid":{"rendered":"https:\/\/365stack.in\/?p=2044"},"modified":"2021-12-31T06:40:56","modified_gmt":"2021-12-31T06:40:56","slug":"how-to-stop-infinite-flow-trigger-in-power-automate-using-csom","status":"publish","type":"post","link":"https:\/\/365stack.in\/index.php\/2021\/12\/31\/how-to-stop-infinite-flow-trigger-in-power-automate-using-csom\/","title":{"rendered":"How to stop infinite flow trigger in Power Automate using CSOM"},"content":{"rendered":"\n<p>Infinite flow trigger is a common scenario in workflow softwares like Nintex, K2 and even in Power Automate. There is a classic way of handling it by using the <a href=\"https:\/\/365stack.in\/index.php\/2021\/12\/12\/how-to-stop-infinite-flow-trigger-in-power-automate-using-flag-column\/\" target=\"_blank\" rel=\"noreferrer noopener\">flag column with form<\/a>, <a href=\"https:\/\/365stack.in\/index.php\/2021\/12\/30\/how-to-stop-infinite-loop-using-in-power-automate-using-multiple-lines-of-text\/\" target=\"_blank\" rel=\"noreferrer noopener\">flag column without form<\/a>.<\/p>\n\n\n\n<p>In classic SharePoint sites, Javascript can be injected in the form load, we can use that to set the flag variables, but in modern versions, it is not possible to inject scripts on form load.<\/p>\n\n\n\n<p>Let&#8217;s see some scenarios in which the flow will trigger infinitely,<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Workflow trigger on item update &#8211; If the workflow updates the same item again then flow will trigger infinitely.<\/li><li>Workflow trigger on item create &#8211; If the workflow creates a item in the same list then flow will trigger infinitely.<\/li><\/ol>\n\n\n\n<p>Before the CSOM solution, we will see how the default update actions and Rest API methods are working. In this example, we will see the &#8220;<strong>workflow trigger on item update<\/strong>&#8220;.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Default Update action<\/h4>\n\n\n\n<p>Created a workflow with the trigger as item update and updating an item.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"313\" data-attachment-id=\"2046\" data-permalink=\"https:\/\/365stack.in\/index.php\/2021\/12\/31\/how-to-stop-infinite-flow-trigger-in-power-automate-using-csom\/screenshot-514\/\" data-orig-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?fit=1587%2C775&amp;ssl=1?v=1639330626\" data-orig-size=\"1587,775\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-514\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?fit=300%2C147&amp;ssl=1?v=1639330626\" data-large-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?fit=640%2C313&amp;ssl=1?v=1639330626\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514-1024x500.png?resize=640%2C313&#038;ssl=1\" alt=\"\" class=\"wp-image-2046\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=1587&amp;ssl=1 1587w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-514.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption>Simple Update item action<\/figcaption><\/figure><\/div>\n\n\n\n<p>Once the item is updated as we can see the flow is triggered infinitely.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"274\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2047\" data-id=\"2047\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?resize=640%2C274&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=1857&amp;ssl=1 1857w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-515.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Updating the item<\/figcaption><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"306\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2048\" data-id=\"2048\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?resize=640%2C306&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=1599&amp;ssl=1 1599w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-516.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Flow instances<\/figcaption><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">Rest API method<\/h4>\n\n\n\n<p>SharePoint has a lot of endpoints to communicate with its components. We are going to use a rest API Post method to update an item. Here we are not going to discuss more on the rest API explanation it will be covered in a separate post.<\/p>\n\n\n\n<p>Created a POST method with the respective URI and passed the inputs in JSON format.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"314\" data-attachment-id=\"2049\" data-permalink=\"https:\/\/365stack.in\/index.php\/2021\/12\/31\/how-to-stop-infinite-flow-trigger-in-power-automate-using-csom\/screenshot-520\/\" data-orig-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?fit=1617%2C795&amp;ssl=1?v=1639331398\" data-orig-size=\"1617,795\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Screenshot-520\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?fit=300%2C147&amp;ssl=1?v=1639331398\" data-large-file=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?fit=640%2C314&amp;ssl=1?v=1639331398\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520-1024x503.png?resize=640%2C314&#038;ssl=1\" alt=\"\" class=\"wp-image-2049\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=1617&amp;ssl=1 1617w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-520.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption>Rest API update method<\/figcaption><\/figure><\/div>\n\n\n\n<p>Once the item is updated the flow triggers infinitely. Even there is no System Update in Rest API but there is a similar method called &#8220;ValidateUpdateListItem&#8221; using that we can replicate close to System Update. But it <strong>stops preventing <a href=\"https:\/\/github.com\/SharePoint\/sp-dev-docs\/issues\/7527\" target=\"_blank\" rel=\"noreferrer noopener\">loops<\/a><\/strong> now, So this method is eliminated.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"274\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2050\" data-id=\"2050\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?resize=640%2C274&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=1855&amp;ssl=1 1855w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-517.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Updating the item<\/figcaption><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"238\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2051\" data-id=\"2051\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?resize=640%2C238&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=1615&amp;ssl=1 1615w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-521.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Infinite instances<\/figcaption><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<h4 class=\"wp-block-heading\">CSOM Update<\/h4>\n\n\n\n<p>Here we used &#8220;Send an HTTP request action&#8221; to send requests to SharePoint, anyone who worked in CSOM, JSOM would be familiar with the below XML format.<\/p>\n\n\n\n<p>CSOM and JSOM will have the &#8220;System Update&#8221; method which the backend system never considers as an event and no versions will be created on that item. So the workflow will not trigger, even in Nintex workflow there is an action called &#8220;Set Item&#8221; which will update the item but never triggers the workflow.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Here we can see the method as &#8220;SetFieldValue&#8221;<\/li><li>The column name and value is passed in parameters<\/li><li>Here we passed the GetList method<\/li><li>Relative URL of the list<\/li><li>Which method is going to be performed.<\/li><li>Since it is &#8220;GetItemById&#8221;, ID is passed. <\/li><\/ol>\n\n\n\n<p>1 and 2 represent the action to be performed (it is enclosed inside ) here it is System Update. 3,4,5 and 6 represent where the action should be performed.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"315\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2052\" data-id=\"2052\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?resize=640%2C315&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=1615&amp;ssl=1 1615w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-524.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">JSOM update<\/figcaption><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"306\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2054\" data-id=\"2054\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?resize=640%2C306&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=1628&amp;ssl=1 1628w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-525-1.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">JSOM Update<\/figcaption><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<p>Below is the JSOM code for System Update, but it requires sp.js to run in that context. Here we are sending a request from Power Automate which is not in the SharePoint context, so we can use CSOM API it does not require SP libraries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const ctx = SP.ClientContext.get_current();\n\nconst list = ctx.get_web().get_lists().getByTitle('Infinite Loop');\nconst item = list.getItemById(1);\n\nitem.set_item('Title', 'Loop');\n\/\/ item.update(); \/\/ -&gt; creates new version, updates Editor and modified date\n\/\/ item.updateOverwriteVersion(); \/\/ -&gt; creates no new version, updates Editor and modified date\nitem.systemUpdate(); \/\/ -&gt; creates no new version, Editor and modified date remains untouched\n\nctx.executeQuery(success, failure);<\/code><\/pre>\n\n\n\n<p>CSOM API Request<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>var listRelativeUrl = '\/sites\/site name\/Lists\/Infinite Loop';\nvar itemId = 1;\n\nvar body = `\n  &lt;Request xmlns=\"http:\/\/schemas.microsoft.com\/sharepoint\/clientquery\/2009\" SchemaVersion=\"15.0.0.0\" LibraryVersion=\"16.0.0.0\" ApplicationName=\"Javascript Library\"&gt;\n    &lt;Actions&gt;\n      &lt;Method Name=\"SetFieldValue\" Id=\"4\" ObjectPathId=\"3\"&gt;\n        &lt;Parameters&gt;\n          &lt;Parameter Type=\"String\"&gt;Title&lt;\/Parameter&gt;\n          &lt;Parameter Type=\"String\"&gt;Loop&lt;\/Parameter&gt;\n        &lt;\/Parameters&gt;\n      &lt;\/Method&gt;\n      &lt;Method Name=\"SystemUpdate\" Id=\"5\" ObjectPathId=\"3\" \/&gt;\n    &lt;\/Actions&gt;\n    &lt;ObjectPaths&gt;\n      &lt;Property Id=\"1\" ParentId=\"0\" Name=\"Web\" \/&gt;\n      &lt;Method Id=\"2\" ParentId=\"1\" Name=\"GetList\"&gt;\n        &lt;Parameters&gt;\n          &lt;Parameter Type=\"String\"&gt;${listRelativeUrl}&lt;\/Parameter&gt;\n        &lt;\/Parameters&gt;\n      &lt;\/Method&gt;\n      &lt;Method Id=\"3\" ParentId=\"2\" Name=\"GetItemById\"&gt;\n        &lt;Parameters&gt;\n          &lt;Parameter Type=\"Number\"&gt;${itemId}&lt;\/Parameter&gt;\n        &lt;\/Parameters&gt;\n      &lt;\/Method&gt;\n      &lt;StaticProperty Id=\"0\" TypeId=\"{3747adcd-a3c3-41b9-bfab-4a64dd2f1e0a}\" Name=\"Current\" \/&gt;\n    &lt;\/ObjectPaths&gt;\n  &lt;\/Request&gt;\n`;\n\nconst endpoint = `${siteUrl}\/_vti_bin\/client.svc\/ProcessQuery`;\nconst client = new SPHttpClient();\n\nclient.post(endpoint, {\n  headers: {\n    'Accept': '*\/*',\n    'Content-Type': 'text\/xml;charset=\"UTF-8\"',\n    'X-Requested-With': 'XMLHttpRequest'\n  },\n  body\n})\n  .then(r =&gt; r.json())\n  .then(r =&gt; {\n    if (r&#91;0].ErrorInfo) {\n      throw new Error(r&#91;0].ErrorInfo.ErrorMessage);\n    }\n    return r;\n  });<\/code><\/pre>\n\n\n\n<p>The above XML package will be prepared in the JSOM library and it will be sent to Execute Query method. Here we are creating the XML queries manually and directly passing them to the &#8220;<strong>client.svc<\/strong>&#8221; method.<\/p>\n\n\n\n<p>Now we will update the item to see whether the flow is triggered more than one time.<\/p>\n\n\n\n<div class=\"wp-block-jetpack-slideshow aligncenter\" data-effect=\"slide\"><div class=\"wp-block-jetpack-slideshow_container swiper-container\"><ul class=\"wp-block-jetpack-slideshow_swiper-wrapper swiper-wrapper\"><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"274\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2055\" data-id=\"2055\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?resize=640%2C274&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=1851&amp;ssl=1 1851w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-522.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Update Item<\/figcaption><\/figure><\/li><li class=\"wp-block-jetpack-slideshow_slide swiper-slide\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"301\" alt=\"\" class=\"wp-block-jetpack-slideshow_image wp-image-2056\" data-id=\"2056\" src=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?resize=640%2C301&#038;ssl=1\" srcset=\"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=300&amp;ssl=1 300w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=768&amp;ssl=1 768w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=1536&amp;ssl=1 1536w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=1619&amp;ssl=1 1619w, https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><figcaption class=\"wp-block-jetpack-slideshow_caption gallery-caption\">Action Result<\/figcaption><\/figure><\/li><\/ul><a class=\"wp-block-jetpack-slideshow_button-prev swiper-button-prev swiper-button-white\" role=\"button\"><\/a><a class=\"wp-block-jetpack-slideshow_button-next swiper-button-next swiper-button-white\" role=\"button\"><\/a><a aria-label=\"Pause Slideshow\" class=\"wp-block-jetpack-slideshow_button-pause\" role=\"button\"><\/a><div class=\"wp-block-jetpack-slideshow_pagination swiper-pagination swiper-pagination-white\"><\/div><\/div><\/div>\n\n\n\n<p>The &#8220;ErrorInfo&#8221; is null that means the value is updated properly.<\/p>\n\n\n\n<p>This may be good to update fewer columns, If there are more columns definitely it will be chaotic to see the whole XML again. There are some limitations in updating the multi-select (People picker, Lookup) columns do check it out before considering this approach.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.microsoft.com\/en-us\/openspecs\/sharepoint_protocols\/ms-csom\/3a4f5e25-795f-488f-8c25-892f116bc346\" target=\"_blank\" rel=\"noreferrer noopener\">Reference Link<\/a><\/p>\n\n\n\n<p>To update other column types, Kindly let us know in the comments. Happy Building \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Infinite flow trigger is a common scenario in workflow softwares like Nintex, K2 and even in Power Automate. There is a classic way of handling it by using the flag column with form, flag column without form. In classic SharePoint sites, Javascript can be injected in the form load, we can use that to set the flag variables, but in [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2056,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[8,32,4],"tags":[75,35,33,10,30],"class_list":["post-2044","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-automate","category-power-platform","category-sharepoint","tag-infinite-loop","tag-infopath-to-powerapps","tag-power-platform","tag-powerautomate","tag-sharepoint"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-523.png?fit=1619%2C761&ssl=1?v=1639334604","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":2060,"url":"https:\/\/365stack.in\/index.php\/2021\/12\/12\/how-to-stop-infinite-flow-trigger-in-power-automate-using-flag-column\/","url_meta":{"origin":2044,"position":0},"title":"How to stop infinite flow trigger in Power Automate using flag column","author":"Hemanthkumar Rajan","date":"December 12, 2021","format":false,"excerpt":"Infinite flow trigger is a common scenario in workflow softwares like Nintex, K2 and even in Power Automate. If the Canvas app is involved in this process we can handle it easily with the \"Flag\" column. Create a Flag column with default values as \"Yes\" Flag Column Customize form for\u2026","rel":"","context":"In &quot;Canvas Apps&quot;","block_context":{"text":"Canvas Apps","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/powerapps\/canvas-apps\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-530.png?fit=1200%2C562&ssl=1%3Fv%3D1639337681&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2187,"url":"https:\/\/365stack.in\/index.php\/2021\/12\/30\/how-to-stop-infinite-loop-using-in-power-automate-using-multiple-lines-of-text\/","url_meta":{"origin":2044,"position":1},"title":"How to stop infinite loop in Power Automate using Multiple lines of text","author":"Hemanthkumar Rajan","date":"December 30, 2021","format":false,"excerpt":"We have previously discussed how to stop infinite flow using CSOM update, flag column with form and modified by column, By the way, in this method we can do from the workflow itself even if we don't have a customized form and it will be much easier than the uglier\u2026","rel":"","context":"In &quot;Power Automate&quot;","block_context":{"text":"Power Automate","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/power-automate\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-566.png?fit=1181%2C735&ssl=1%3Fv%3D1639846959&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1220,"url":"https:\/\/365stack.in\/index.php\/2021\/07\/05\/a-complete-guide-for-migration-to-power-platform-pre-development-analysis-part-1\/","url_meta":{"origin":2044,"position":2},"title":"A Complete Guide for Migration to Power Platform: Pre-Development Analysis &#8211; Part 1","author":"Hemanthkumar Rajan","date":"July 5, 2021","format":false,"excerpt":"If the application is going to be created from a new requirement, we can focus only on the Power Platform by analyzing the use cases of the requirement and a feasibility study should suffice for common scenarios like approval, functions, references, CRUD operations, integrations, performance, limitations has to be taken\u2026","rel":"","context":"In &quot;Power Platform&quot;","block_context":{"text":"Power Platform","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/"},"img":{"alt_text":"Pre Development Analysis","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/07\/Requirement-Anlaysis-scaled.jpeg?fit=1200%2C829&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1310,"url":"https:\/\/365stack.in\/index.php\/2021\/07\/28\/a-complete-guide-for-migration-to-power-platform-analysis-development-part-2\/","url_meta":{"origin":2044,"position":3},"title":"A Complete Guide for Migration to Power Platform: Analysis &#038; Development &#8211; Part 2","author":"Hemanthkumar Rajan","date":"July 28, 2021","format":false,"excerpt":"This is a continuation post on the Analysis and Development series, have a look at Part -1 of this post for a better understanding. After properly analyzing the existing system, we might be in a good position to start the development. Let's see the list of things that should be\u2026","rel":"","context":"In &quot;Power Platform&quot;","block_context":{"text":"Power Platform","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/"},"img":{"alt_text":"Requirement Analysis","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/07\/Requirement-Analysis.png?fit=1100%2C700&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2062,"url":"https:\/\/365stack.in\/index.php\/2022\/05\/01\/how-to-update-editor-and-author-fields-in-sharepoint-using-power-automate\/","url_meta":{"origin":2044,"position":4},"title":"How to update editor and author fields in SharePoint using Power Automate","author":"Hemanthkumar Rajan","date":"May 1, 2022","format":false,"excerpt":"Power Automate will run under owner connection or we can change the connection for a specific action. So when an update item or create item action is used in the flow, the \"created by\" or \"modified by\" will be updated by owner name or whoever name is configured in the\u2026","rel":"","context":"In &quot;Power Automate&quot;","block_context":{"text":"Power Automate","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/power-automate\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2021\/12\/Screenshot-544.png?fit=915%2C721&ssl=1%3Fv%3D1639683153&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2404,"url":"https:\/\/365stack.in\/index.php\/2022\/01\/06\/trigger-flow-when-a-folder-is-created-in-the-sharepoint-library\/","url_meta":{"origin":2044,"position":5},"title":"Trigger flow when a folder is created in the SharePoint library","author":"Hemanthkumar Rajan","date":"January 6, 2022","format":false,"excerpt":"There are many triggers available for SharePoint list and libraries but in some cases, the flow should be triggered only a folder is created or a file is created inside the library, there are no direct triggers available but with the help of conditions we can trigger the flow when\u2026","rel":"","context":"In &quot;Power Automate&quot;","block_context":{"text":"Power Automate","link":"https:\/\/365stack.in\/index.php\/category\/power-platform\/power-automate\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/365stack.in\/wp-content\/uploads\/2022\/01\/Screenshot-714.png?fit=1043%2C763&ssl=1%3Fv%3D1641471039&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/2044","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/comments?post=2044"}],"version-history":[{"count":9,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/2044\/revisions"}],"predecessor-version":[{"id":2324,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/posts\/2044\/revisions\/2324"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/media\/2056"}],"wp:attachment":[{"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/media?parent=2044"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/categories?post=2044"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/365stack.in\/index.php\/wp-json\/wp\/v2\/tags?post=2044"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}