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 use a loop that...
Power Automate
Answered

How to use a loop that repeats only certain lines with PAD

(0) ShareShare
ReportReport
Posted on by 7

How can I use a for loop to process data like the image for each serial number?

 

EK0611_1-1689654276070.png

What I want to do...

 

1) Search for C1200

    ⇒ Sequentially enter S# and ID# on the newly displayed screen, one line at a time,

    in sequence and  submit (not including S# ID# of another Serial#)

2) Search for C1201 => same process as above

3) Search for C1205 => Same process as above

 

How can I repeat this kind of task?

since serial# is not always same, so I am facing the problem.

Categories:
  • EK0611 Profile Picture
    7 on at

    correct typo  C# ⇒ S#

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @EK0611 

     

    Here is the flow which you could refer to get the records group by Serial#:

    1. Firstly, we will fetch the records from excel using 'List rows present in a table' action:

    ManishSolanki_0-1689656510739.png

     

    2. Next, we will create an array of string for column Serial# using 'Select' action. You need to click on 'Switch to text mode' button to enter select the 'Serial#' field from Dynamic content:

    ManishSolanki_1-1689656678252.png

    ManishSolanki_2-1689656743369.png

     

    3. Now, we will find the distinct values of 'Serial#' using union() function and iterate using 'Apply to each action'

    ManishSolanki_3-1689656868481.png

     

    Expression used for finding the distinct values:

    union(body('Select_2'),body('Select_2'))

     

    we will collect the value of each 'Serial#' value in Compose action for each iteration:

    ManishSolanki_4-1689656972573.png

    Expression used inside 'Compose' action:

    item()

     

    Next, we will use 'Filter array' action to filter the records from original excel records based on 'Serial#' (current item in iteration):

    ManishSolanki_5-1689657141831.png

     

    The result or output of filter action will give the records which are grouped by 'Serial#' column.

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

  • EK0611 Profile Picture
    7 on at

    thank you! @ManishSolanki

     

    I tried it and  worked correctly 😊

    unfortunately, I am not premium member of power automate
    so I cannot use this script combine with original PAD script.
    but, this solution was really helpful.
    thank you so much for your great answer!

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard