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,138 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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 463

#1
Valantis Profile Picture

Valantis 463

#3
11manish Profile Picture

11manish 264

Last 30 days Overall leaderboard