<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Guide: Working with Nested Repeats in Power Automate in ArcGIS Survey123 Questions</title>
    <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569950#M60580</link>
    <description>&lt;P&gt;Disregard - I think the HTML table will do exactly what I need it to. Just had the columns input automatically from the array I set up. Thanks!!&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2024 20:19:48 GMT</pubDate>
    <dc:creator>WilderNiss1</dc:creator>
    <dc:date>2024-12-18T20:19:48Z</dc:date>
    <item>
      <title>Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1473274#M56903</link>
      <description>&lt;P class="lia-align-center"&gt;&lt;STRONG&gt;&lt;A href="https://community.esri.com/t5/arcgis-survey123-questions/guide-generate-feature-reports-in-power-automate/td-p/1377177" target="_self"&gt;My parent thread with additional Power Automate Guides&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Working with repeats in Power Automate isn't always intuitive, but it is doable. And once you learn a few basics, you should have no problem transforming your data the way you need.&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;Goal: Enter repeat data from Survey123 submission into an Excel table &lt;U&gt;without duplicates&lt;/U&gt;.&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_1-1715807183274.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104226i648BC4CCE2AA3698/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_1-1715807183274.png" alt="abureaux_1-1715807183274.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;First, I need a survey with a nested repeat:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_8-1715790427036.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104197i22027593F13EA863/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_8-1715790427036.png" alt="abureaux_8-1715790427036.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_7-1715790188116.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104196i22C5BE7BBBAEB6F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_7-1715790188116.png" alt="abureaux_7-1715790188116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Next, I need a place to dump my data.&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt; I will be using Excel&lt;/STRONG&gt;, but you could also use a database, SharePoint, or even an email with an HTML table--There are a ton of options. Whichever option you choose, the steps to get there are still the same.&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_4-1715789229687.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104191i11EA9643079FF449/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_4-1715789229687.png" alt="abureaux_4-1715789229687.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_5-1715789374086.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104193i3B66118E49E1EC4D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_5-1715789374086.png" alt="abureaux_5-1715789374086.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Now, for the flow. Go to Power Automate &amp;gt; New flow &amp;gt; Instant cloud flow &amp;gt; Skip &amp;gt; turn off 'New designer' (located top right). You should see this:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_2-1715785696724.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104182i9120F2A0CA31DD8B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_2-1715785696724.png" alt="abureaux_2-1715785696724.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Select your trigger: &lt;EM&gt;When a survey response is submitted&lt;/EM&gt;. Then, select your survey. &lt;/STRONG&gt;This is the ONLY difference between this flow in AGO and Enterprise (AGO connector for AGO, custom Enterprise connector for Enterprise... at least for now). Also, I added corporate colours and a random icon to my custom Enterprise connection, so it &lt;U&gt;will&lt;/U&gt; look different than yours. That's okay! They are all the same connection. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_3-1715785799843.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104183i390CCB29EE30FE2A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_3-1715785799843.png" alt="abureaux_3-1715785799843.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Add a &lt;EM&gt;Parse JSON&lt;/EM&gt; step &amp;gt; format like below &amp;gt; save your flow &amp;gt; turn on your flow (if not done so already):&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_9-1715802688297.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104207i9498FE38307DE9FE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_9-1715802688297.png" alt="abureaux_9-1715802688297.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Go into Survey123 and ensure you download any pending updates for your survey. Then, fill out all the fields you care about, ensuring you only add a single item to each repeat. Finally, submit the survey. &lt;/STRONG&gt;NOTE: Adding the &lt;EM&gt;When a survey response is submitted&lt;/EM&gt; step in Power Automate adds a webhook to your survey, which in turn results in a pending update for that same survey. You &lt;U&gt;need&lt;/U&gt; this update for the flow to work.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_10-1715802958850.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104208i9ABCE44D8E80E464/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_10-1715802958850.png" alt="abureaux_10-1715802958850.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Go back to Power Automate and open the flow that just ran&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_11-1715803036535.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104209i4BA181AD47AF9E8C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_11-1715803036535.png" alt="abureaux_11-1715803036535.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Open your trigger and copy the body.&lt;/STRONG&gt; Before you ask, we are doing this because working with the &lt;EM&gt;Parse JSON&lt;/EM&gt; step, rather than the body directly, makes a lot life easier. For example, we can trim the content down to exactly what we need.&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_13-1715803117526.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104212iEBBDA27B4F7EA7AA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_13-1715803117526.png" alt="abureaux_13-1715803117526.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Open your favourite script editor (HINT: It's &lt;A href="https://code.visualstudio.com/download" target="_self"&gt;VS Code&lt;/A&gt;) and paste in the &lt;EM&gt;body&lt;/EM&gt;. Then trim it down to contain only the fields you care about. At a minimum, you will need all "uniquerowid" and "parentrowid" fields, as well as the "attributes" blocks with some attributes (you know, the stuff going into your table/database). Don't forget to replace all the text with the word "null" as I have below. This can/will save future headaches.&lt;/STRONG&gt; I don't always make uniquerowid and parentrowid fields null right away, but I do when I am ready to move into production. Reason is that if you select a string in VS Code, it highlights matching strings... This lets you see the connection between the different ids!&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;uniquerowid&lt;/STRONG&gt; is always unique&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;parentrowid &lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#3366FF"&gt;is only found in children (e.g., a repeat), and it always matches it's parent's uniquerowid&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;{
    "feature": {
        "attributes": {
            "m_date": null,
            "m_person": null,
            "uniquerowid": "{24BECBC8-F8A8-46CC-9AFD-990ABDCB80D7}"
        },
        "result": {
            "objectId": null
        },
        "repeats": {
            "r1_survey_rpt": [
                {
                    "attributes": {
                        "r1_block": null,
                        "r1_lot": null,
                        "r1_plan": null,
                        "parentrowid": "{24BECBC8-F8A8-46CC-9AFD-990ABDCB80D7}",
                        "uniquerowid": "{F41E1C35-CB5C-4AB0-B8E5-A5009C90B61B}"
                    },
                    "repeats": {
                        "r2_tree_rpt": [
                            {
                                "attributes": {
                                    "r2_tree_sct": null,
                                    "parentrowid": "{F41E1C35-CB5C-4AB0-B8E5-A5009C90B61B}"
                                }
                            }
                        ]
                    }
                }
            ]
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Copy what you have in VS Code (or copy mine from above if you are replicating what I am doing). In Power Automate: Go to &lt;EM&gt;Parse JSON&lt;/EM&gt; &amp;gt; click &lt;EM&gt;Generate from sample&lt;/EM&gt; &amp;gt; paste in the copied text &amp;gt; press &lt;EM&gt;Done&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_1-1715804527643.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104218i9816689B6A98D7C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_1-1715804527643.png" alt="abureaux_1-1715804527643.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Now for the fun part. We want to add rows to our table/database based on the &lt;U&gt;most nested repeat&lt;/U&gt;. In my case, that's ${r2_tree_rpt}. &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Add&amp;nbsp;&lt;EM&gt;Condition&lt;/EM&gt;. As we work our way down to the most nested repeat, we need to start at the "top" (aka, the main Feature Layer) and descend from there. Here I have circled the parameters in the order that they will be used:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_3-1715808704580.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104233iCF3141E40E2C2547/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_3-1715808704580.png" alt="abureaux_3-1715808704580.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;Now, you might be asking yourself "which is which? They all look the same in Power Automate!" Well, Power Automate adds things to the Dynamic Content list &lt;U&gt;in order&lt;/U&gt;. Go to your JSON in VS Code (or just look at mine above). The first uniquerowid in VS Code is the top result in Power Automate's Dynamic Content.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;In your &lt;EM&gt;Condition&lt;/EM&gt;: On the left, add uniquerowid, and on the right, add parentrowid. &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_4-1715808866969.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104234i0B6F20B0FDAC9A58/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_4-1715808866969.png" alt="abureaux_4-1715808866969.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;As soon as you add parentrowid to the &lt;EM&gt;Condition&lt;/EM&gt;, Power Automate adds an &lt;EM&gt;Apply to Each&lt;/EM&gt; for you. That is what we want. Just ensure you got the correct parameters by hovering over them and checking their path.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_5-1715809006229.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104236i37AB5643F426EF2D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_5-1715809006229.png" alt="abureaux_5-1715809006229.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Now, we do the same for the next level. On the "YES" side of our &lt;EM&gt;Condition&lt;/EM&gt;, we add another &lt;EM&gt;Condition:&amp;nbsp;&lt;/EM&gt;On the left, add uniquerowid, and on the right, add parentrowid.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_6-1715809259130.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104238iD07E4B4C83B7F936/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_6-1715809259130.png" alt="abureaux_6-1715809259130.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;And again, if you want to confirm your selections:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_7-1715809440695.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104239i9AD861C749135849/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_7-1715809440695.png" alt="abureaux_7-1715809440695.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Final step is to add your data transformation step. As I mentioned earlier, I am dumping my data into Excel:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_8-1715809897450.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104241iB07293562446EE5E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_8-1715809897450.png" alt="abureaux_8-1715809897450.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;That's it!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_10-1715810339254.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104243iE6FDB5DDB5491501/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_10-1715810339254.png" alt="abureaux_10-1715810339254.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;If we test, there should be zero duplicates (trust me when I say that there are no duplicates in this screen cap).&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_9-1715810110022.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/104242i2669B8EF463B5000/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_9-1715810110022.png" alt="abureaux_9-1715810110022.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;*** One small note. If you test on Excel, just know that SharePoint can be slow to realize data has been added. It took ~20 seconds for my flow to run, but then another 1 minute before my data actually appeared in the table.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF00FF"&gt;&lt;STRONG&gt;I have attached a couple files to help. One is the XLSX that I used here. The other is a high-level overview of the end result compared to VS Code.&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2024 17:43:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1473274#M56903</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2024-05-31T17:43:21Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1496175#M57483</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;There's somethin that im not getting.&lt;/P&gt;&lt;P&gt;Do i have to change the word GlobalID for the word uniquerowid and ParentGlobalID for parentrowid in the body.&lt;/P&gt;&lt;P&gt;The&amp;nbsp; structure of text that i have copied from the body is identical to what you have with my particular fields , but these two fields are different.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Juan_FelipeVillegas_0-1719006288539.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/107699i1595FB6D184EF361/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Juan_FelipeVillegas_0-1719006288539.png" alt="Juan_FelipeVillegas_0-1719006288539.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 21:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1496175#M57483</guid>
      <dc:creator>Juan_FelipeVillegas</dc:creator>
      <dc:date>2024-06-21T21:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569484#M60552</link>
      <description>&lt;P&gt;Thanks very much to this guide! You mention above to fill out the survey including "all fields you care about". How should we approach this if our survey has two "paths" depending on an answer and relevant fields? I care about both paths, but it isn't possible to fill out a survey both ways. How can all those fields be captured in a parse JSON step? For example: Surveyor answers a question about the status of a nest. If they select that the nest fails, they are asked about options on how it may have failed (human, predator, weather, etc.). But if they select active, they are asked questions about how many eggs are in the nest. Is it possible to structure an email that would report both fields (from the JSON parsed out) in an email out to surveyors? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 19:22:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569484#M60552</guid>
      <dc:creator>WilderNiss1</dc:creator>
      <dc:date>2024-12-17T19:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569519#M60554</link>
      <description>&lt;P&gt;That's a great question!&lt;/P&gt;&lt;P&gt;I have a few like that as well. Honestly, adding data to the fields is just a nice quality of life thing. You can also do it manually.&lt;/P&gt;&lt;P&gt;Here are a few options:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Submit the survey twice, and make two separate JSON files for the two separate paths. You can use the "Switch" step in Power Automate to create a branched flow. &lt;EM&gt;This is likely the most straight forward approach as it replicates how your survey is set up. I put an example of this below. Depending on how your survey is set up though, the next option may be better.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Submit a survey for "Path A" where you fill in all the applicable fields. Then, submit a survey for "Path B" were you follow the same procedure. And finally, combine the two separate JSON into a single block of code. As long as you drop things into the correct spots, this works well. &lt;EM&gt;While similar to the first option, this option would keep the entire flow in a "single direction". Depending on how things are set up, this may be a better idea.&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Submit a survey for "Path A" where you fill in all the applicable fields. Then, manually add the missing content to the JSON. &lt;EM&gt;This is similar to the previous option, but is just more manual.&amp;nbsp; &lt;/EM&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In any case, make &lt;EM&gt;extra&lt;/EM&gt; sure you set all the values to "null" in the JSON (as per the steps in my original post). Power Automate gets really grouchy when it expects a specific data type just to be fed nothing.&lt;/P&gt;&lt;P&gt;If you go with the branched approach, you may end up having two separate emails. In that case, it is likely straight forward what to do. However, even when I use a branched approach to a flow, I tend to share as many of the common elements as possible to avoid making extra work for myself. In many cases, that means I share the final email. If that ends up being the case for you, I'd suggest you use "Initialize Variable" to set a text variable. You can then "Set Variable" with each of the branches, and then call upon that variable &lt;EM&gt;outside&lt;/EM&gt; the branches. Here is a quick example that may help illustrate what I mean:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_0-1734465589519.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/121974i895C2215E72E265B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_0-1734465589519.png" alt="abureaux_0-1734465589519.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(Note: You may also be able to substitute the "Condition" step for the "Switch" step. If you only have two branches, they essentially do the same thing)&lt;/P&gt;</description>
      <pubDate>Tue, 17 Dec 2024 20:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569519#M60554</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2024-12-17T20:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569802#M60570</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/454586"&gt;@abureaux&lt;/a&gt;&amp;nbsp;Thanks for taking the time to provide such a thorough answer! I actually discovered in between the time that I asked this question and when you answered it that a parseJSON will still show all the "not relevant" fields in the output as null, even if the surveyor never saw those questions (e.g. they were on a different path). So it doesn't appear that the manual step of combining them would be necessary? At least it doesn't appear so for me.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;A note on this, I don't have any nested repeats, I was just trying to learn how to do the JSON action so I can better understand what my variables are because they are so dang hard to read in the dynamic content viewer in Power Automate. All I am trying to do is create an email that includes all the filled in contents of a repeat (in fact of a couple different repeats). So in a separate branch of the flow I've used the "Initialize Variable" step to create an array, then set up an "Apply to each" around "Append to Array variable" for the fields in my repeat. I got those steps from this guide&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-working-with/ba-p/1371206" target="_blank"&gt;https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-working-with/ba-p/1371206&lt;/A&gt;.&amp;nbsp; I am hoping to create parallel branches of this for each separate repeat. Then I just need to figure out how&amp;nbsp;add that array into the body of my email, since I am not working with attachments as that example explains. You go over how to add the repeat data into an excel, but what about if you just want to display it in an email out to a group of people?&lt;BR /&gt;&lt;BR /&gt;Thanks for the explanation of the switch, I wasn't aware of that capability, and even if I don't use it for this survey I may in the future and others will hopefully find it useful as well.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 15:55:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569802#M60570</guid>
      <dc:creator>WilderNiss1</dc:creator>
      <dc:date>2024-12-18T15:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569827#M60572</link>
      <description>&lt;P&gt;Ahhh, okay. That makes more sense!&lt;/P&gt;&lt;P&gt;Ya, using ParseJSON makes life 1000% easier, and for that reason I use this action on all of my S123 flows to parse out that initial S123 response.&lt;/P&gt;&lt;P&gt;The easiest "array" you can add to an email would &lt;EM&gt;probably &lt;/EM&gt;be the &lt;EM&gt;Create HTML Table&lt;/EM&gt; action. Without knowing what the array contains, it's hard to say though. To use the Create HTML Table action, first dump all your data into that table (likely with an Apply to Each), and then dump that table into an email. For more control over how the table is created, press "Show Advanced", and then for Columns select "Custom".&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="abureaux_0-1734539258899.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122034iD813ACE8B8477671/image-size/medium?v=v2&amp;amp;px=400" role="button" title="abureaux_0-1734539258899.png" alt="abureaux_0-1734539258899.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 16:30:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569827#M60572</guid>
      <dc:creator>abureaux</dc:creator>
      <dc:date>2024-12-18T16:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569942#M60579</link>
      <description>&lt;P&gt;Thanks! For the purposes of my example, the array I've created and want to add into an email is just a few fields. The repeat is designed such that surveyors can report band combos of all birds they see on a survey. So the Append to array (Apply to Each) is set up as so:&amp;nbsp;{&lt;BR /&gt;"Band Combo": @{items('Apply_to_each')?['attributes/band_combo']},&lt;BR /&gt;"Sex": @{items('Apply_to_each')?['attributes/sex']},&lt;BR /&gt;"Age": @{items('Apply_to_each')?['attributes/age']},&lt;BR /&gt;"Presumed Band": @{items('Apply_to_each')?['attributes/presumed_band']},&lt;BR /&gt;"Bird Notes": @{items('Apply_to_each')?['attributes/bird_notes']}&lt;BR /&gt;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is an HTML table the only way to put data from a repeat like this into an email? I agree it does sound like the simplest. I was just wondering if there was anything that could be replicated with a "apply to each" structure within the body of the email.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like If the email had a section as&amp;nbsp;&lt;/P&gt;&lt;P&gt;Birds Seen:&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Band_combo],[Sex],[Age] ([Bird_notes]) &amp;lt;- and then just have this add a line in the email like this for each bird seen? I'm probably asking too much haha&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 20:06:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569942#M60579</guid>
      <dc:creator>WilderNiss1</dc:creator>
      <dc:date>2024-12-18T20:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Guide: Working with Nested Repeats in Power Automate</title>
      <link>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569950#M60580</link>
      <description>&lt;P&gt;Disregard - I think the HTML table will do exactly what I need it to. Just had the columns input automatically from the array I set up. Thanks!!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2024 20:19:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-survey123-questions/guide-working-with-nested-repeats-in-power/m-p/1569950#M60580</guid>
      <dc:creator>WilderNiss1</dc:creator>
      <dc:date>2024-12-18T20:19:48Z</dc:date>
    </item>
  </channel>
</rss>

