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 do I conditionally...
Power Automate
Unanswered

How do I conditionally iterate through a datatable?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

In short, I want to perform iterative actions with data in a datatable, only if a certain value exists in one of the columns. I've set it up as follows:

 

For each "Current Item" in DataTable

     If "Column" = "Value"

      - perform action 1

      - perform action 2

    End 

 

 

However, the flow simply skips over the the "IF" steps and ends, despite the fact that there are records in the DataTable with "Value" in the "Column" field. 

  • kinuasa Profile Picture
    803 Most Valuable Professional on at

    Hi,
    It is necessary to specify a column name or index when using the IF action.

     

    Regards,
    kinuasa

     

    *Below is a sample code. Please copy and paste to use.

    SET DataTable TO { ^['Name', 'Position', 'Office'], ['Ashton Cox', 'Junior Technical Author', 'San Francisco'], ['Bruno Nash', 'Software Engineer', 'London'], ['Cedric Kelly', 'Sales Assistant', 'New York'] }
    LOOP FOREACH CurrentItem IN DataTable
     IF CurrentItem['Office'] = $'''New York''' THEN
     Display.ShowMessageDialog.ShowMessage Message: CurrentItem Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: True ButtonPressed=> ButtonPressed
     END
    END
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @Anonymous 

     

    Kindly check whether there is any space in the value, so while comparing, Trim that space 

     

    Hope this helps !!!

     

    thanks & regards,

    Nived N

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
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 211 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 190

Last 30 days Overall leaderboard