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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Cannot get CurrentItem...
Power Automate
Unanswered

Cannot get CurrentItem to work within a Loop in Power Automate Desktop

(0) ShareShare
ReportReport
Posted on by 2

I'm new to power automate.  I'm trying to do a simple look up of a last name from excel and then using SQL to return the patient number from our database.  I've watched several videos and looked at several posts on this board, but something seems off.  If I hard code a last name into the SQL, it finds the patient number, but when I use %CurrentItem['last name'], it finds nothing. 

 
 
 
 
 

QoE71_7-1714407342921.png

 

It is my understanding that the correct syntax is %CurrentItem['last name'], yet when I use that, it does not make any hits in my excel sheet.  

 

When I click on the variable button and select CurrentItem, it inserts this which looks different from every video and post I have seen.

QoE71_1-1714405658622.png

 

I would appreciate any insight that could be offered.

 

Thanks

 

 

Categories:
I have the same question (0)
  • Nguyen-WI Profile Picture
    15 on at

    Looks like the problem is the data isn't being accessed properly.

    I use PA for more CRUD related operations so what I need to write seems to be different than yours.

     

    When using array notation, it typically looks like the follow for me:

    item( )?['property']

    Notice the "?" prior to accessing the property

     

    Else, try dot notation:

    $(CurrentItem.'last name')
    %CurrentItem.'last name'

     

    I don't have experience using PA with Excel or SQL so I can't speak for the syntax but it looks like you just need to figure out the correct syntax.

     

  • QoE71 Profile Picture
    2 on at

    Thank you for the response.  Unfortunately, I've tried the three different notations you suggested and they either errored out or didn't return a value.  I'm confused as to why the variable looks different from other variables I've used in other automations.  I guess I still have a lot to learn about Power Automate Desktop.

     

    Thank you again,

    Lisa

  • Nguyen-WI Profile Picture
    15 on at

    @QoE71 wrote:

    Thank you for the response.  Unfortunately, I've tried the three different notations you suggested and they either errored out or didn't return a value.  I'm confused as to why the variable looks different from other variables I've used in other automations.  I guess I still have a lot to learn about Power Automate Desktop.

     

    Thank you again,

    Lisa


    My last guess:

    "to access a property of a dynamic variable, you typically use the %VariableName.PropertyName% format"

    %CurrentItem.LastName% // Make sure you properly rename the property

     

    I hope this helps or you find the solution soon!

  • CU01122313-0 Profile Picture
    2 on at
    Hi Lisa, 

    I too have a similar problem. 

    I tried following this excellent tutorial, https://youtu.be/FH_7D402lP8?si=KsJ_jmvIx2DQoToh

    But at 1:58 he opens the "Read from Excel" action and the Excel Instance on the action is prefilled with %ExcelInstance" and I understand why. However when I add in the action mine is prefilled with =ExcelInstance (NOTE no % signs used...) BUT It works.

    However it all falls apart. 
    Later, at 6:01 again his action shows %Currentitem% whereas mine shows =CurrentItem but after that I can't get it to work!?!?!

    I can't imagine they have changed the way PA works and the video is out of date, but I'm baffled.
  • Thanura09 Profile Picture
    192 on at
    I suppose this happens when you check the 'enable powerFx' in the begining, so the traditional methods won't work as intended, therefore you should access this as =CurrentItem.'Column Name' (if  column is text type)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard