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 get CurrentItem...
Power Automate
Answered

How to get CurrentItem Value inside a For Each Loop

(0) ShareShare
ReportReport
Posted on by 6

So, I have a For Each Loop with the property "CurrentItem".  CurrentItem returns sql columns format(Im using SQL queries within power automate desktop), with multiple fields. I want only one field from "CurrentItem", that is field "DSGrupo". How can i filter this within "Define Variable" action or inside "Execute SQL Query" Action?? I have tried creating a variable called "DescGrupo", and I have assigned this value to it: items()?['DS_Grupo']. The variable assign activity is inside for each, i also tried items(CurrentItem)?['DS_Grupo']. 

 

In the "Execute SQL" action, I tried the following:  SELECT * FROM dbo.Link WHERE DS_Grupo = "%DescGrupo%"

but it didnt work. 

 

Prints below.

 

Any help is appreciated

 

 

printAssignVariable.png
error currentItem.png
printQuery.png
I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Try using %CurrentItem['DS_Grupo']%. This is the correct syntax to reference a column in a data row.

    -------------------------------------------------------------------------

    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

     

  • Verified answer
    Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @SamuelMDC1 

     

    You have made one mistake, instead of item()?['DS_Grupo'] you have to use %CurrentItem['DS_Grupo']% in define variable.

     

    Note that item()?['DS_Grupo'] is used in power automate cloud flow.

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard