web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to stop iterating ...
Power Automate
Answered

How to stop iterating from json data?

(0) ShareShare
ReportReport
Posted on by 357

Hi Team,

I want to stop my loop once the all data has been extracted from the json.

Now I have used while loop to iterate through json data , and also use increment for table data from json

 

set variable var_FormattedTableCounter = 9 

FOR EACH %JsonAsCustomObject[var_FormattedTableCounter]['raw_material_table']['rows']%

 

so my json contains more than 100 table data 

 

so how can I stop my loop once the all data has extracted from the json.
Deu to custom object I can not iterate directly using for each. I am passing counter in for each so that I am able to iterate.
I want to stop once the all data has been extracted from the json

Within while loop I have used for each 

I have the same question (0)
  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    Could you pls share your Json format after removing all sensitive info to understand your use case in deep?

    So that i will try to convert your json and see how it looks like in custom object and suggest appropriately.

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀 

  • Sanket1 Profile Picture
    357 on at

    this one part of json

    "31": {
            "raw_material_table": {
                "headers": [
                    """",
                    """",
                    """",
                    """",
                    """",
                    """",
                    """",
                    """.",
                    """"
                ],
                "rows": [
                    {
                        """": "01.",
                        """": "Aprepitant",
                        """": "534.0",
                        """": "0.0936",
                        """": "1.0",
                        """": "50.0 gm",
                        """": "Fos/R.18n/851/03/ FosIR184/851/144",
                        """.": "-",
                        """": "-"
                    },
                    {
                        """": "02.",
                        """": "TBPP .",
                        """": "538.0",
                        """": "0.130",
                        """": "1.39",
                        """": "70.0 8",
                        """": "foste.187 (8511080,",
                        """.": "-",
                        """": ""
                    },
                    {
                        """": "03",
                        """": "THE cory)",
                        """": "-",
                        """": "-",
                        """": "10vol",
                        """": "500ml",
                        """": "8.2 . fine.",
                        """.": "-",
                        """": "-"
                    },
                    {
                        """": "",
                        """": "NOCHMOS (1. OM in THE)",
                        """": "183.0",
                        """": "0.25m",
                        """": "2.677",
                        """": "250ml.",
                        """": "Hitest org.",
                        """.": "-",
                        """": "-"
                    },
                    {
                        """": "65",
                        """": "Nayco 3.",
                        """": "-",
                        """": "-",
                        """": "",
                        """": "300 gr",
                        """": "commential",
                        """.": "-",
                        """": "-"
                    },
                    {
                        """": "06",
                        """": "ManSoG. H2O.",
                        """": "-",
                        """": "-",
                        """": "-",
                        """": "100 gm.",
                        """": "commential.",
                        """.": "-",
                        """": "-"
                    }
                ]
            },
            """n_table": {
                "headers": [
                    """.",
                    """n",
                    """",
                    """",
                    """",
                    "O"""
                ],
                "rows": [
                    {
                        """.": "01.",
                        """n": "Che Arranged 2. 0 lit",
                        """": "10:00",
                        """": "10:15",
                        """": "-",
                        "O""": ""
                    },
                    {
                        """.": "-",
                        """n": "PSF.",
                        """": "",
                        """": "",
                        """": "",
                        "O""": ""
                    },
                    {
                        """.": "02.",
                        """n": "charged 50 ogm Aprepitant",
                        """": "10:15",
                        """": "10:20",
                        """": "27\u00b0\u2103",
                        "O""": ""
                    },
                    {
                        """.": "03-",
                        """n": "charged 250 ml. THF.",
                        """": "10:20",
                        """": "10:5",
                        """": "28 \u2103",
                        "O""": ""
                    },
                    {
                        """.": "04.",
                        """n": "che dissolved 70 gr TBPP",
                        """": "10:5",
                        """": "10:30",
                        """": "24\u2103",
                        "O""": ""
                    },
                    {
                        """.": "-",
                        """n": "dn 250 ml. JHF, filtered and",
                        """": "-",
                        """": "-",
                        """": "-",
                        "O""": ""
                    },
                    {
                        """.": "-",
                        """n": "charged into Rsf.",
                        """": "-",
                        """": "-",
                        """": "",
                        "O""": ""
                    },
                    {
                        """.": "05",
                        """n": "Rm coat to 0-5\u2103",
                        """": "10:30",
                        """": "11:00",
                        """": "0 2\u2103",
                        "O""": ""
                    },
                    {
                        """.": "06",
                        """n": "Added 250 Ml. Natimos",
                        """": "11:00",
                        """": "-",
                        """": "",
                        "O""": ""
                    },
                    {
                        """.": "-",
                        """n": "Slowly.",
                        """": "-",
                        """": "11:55",
                        """": "-",
                        "O""": ""
                    },
                    {
                        """.": "",
                        """n": "Rm stirred",
                        """": "11:55",
                        """": "14:00",
                        """": "10 2 \u2103",
                        "O""": ""
                    },
                    {
                        """.": "08",
                        """n": "Removed RD.1 for HPLC.",
                        """": "12:00",
                        """": "13:05",
                        """": "3 \u2103",
                        "O""": ""
                    },
                    {
                        """.": "09.",
                        """n": "stirred",
                        """": "13:05",
                        """": "15:05",
                        """": "2 \u2103",
                        "O""": ""
                    },
                    {
                        """.": "10.",
                        """n": "Removed Rm. 2 for HPLC,",
                        """": "15:05",
                        """": "15:10",
                        """": "2\u2103 0",
                        "O""": ""
                    },
                    {
                        """.": "11.",
                        """n": "Ro quinched in prechilled",
                        """": "15:10",
                        """": "15:20",
                        """": "20\u2103",
                        "O""": "1150 gm Naticos in 1500ml"
                    },
                    {
                        """.": "",
                        """n": "Sat NaHco3 sot? and",
                        """": "-",
                        """": "-",
                        """": "-",
                        "O""": "DmW) ."
                    },
                    {
                        """.": "-",
                        """n": "MTBE (1500 ml+1500 ml).",
                        """": "-",
                        """": "-",
                        """": "-",
                        "O""": ""
                    },
                    {
                        """.": "12",
                        """n": "stirred",
                        """": "15:20",
                        """": "16:00",
                        """": "212",
                        "O""": ""
                    },
                    {
                        """.": "13-",
                        """n": "layer separated.",
                        """": "16:00",
                        """": "16:05",
                        """": "222",
                        "O""": "Continued on passe 00: 050"
                    }
                ]
            },
            "Exp_info": {
                "headers": [
                    //json data
                ],
                "rows": [
                    {
                       //json data
                    }
                ]
            }
        },
  • CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    Share some screenshot how you iterating the above data in your workflow?

  • Sanket1 Profile Picture
    357 on at

    Sanket1_0-1718618446543.png

    2 this is within while loop

    Sanket1_1-1718618496336.png

     

  • Verified answer
    CU16071609-1 Profile Picture
    6,255 Moderator on at

    @Sanket1 

     

    I have already provided my suggestion in another thread on the same topic. Let's continue our discussion there and consider this thread closed.

     

    For future seekers, we already discussing the same topic in below thread - How to stop loop once reached the last element of ... - Power Platform Community (microsoft.com)

     


    Thanks,
    Deenuji Loganathan 👩‍💻
    Automation Evangelist 🤖
    Follow me on LinkedIn 👥

    -------------------------------------------------------------------------------------------------------------
    If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 272 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 147 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 146 Super User 2026 Season 2

Last 30 days Overall leaderboard