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 Apps / LookUp Returning Blank...
Power Apps
Answered

LookUp Returning Blank When Using Variable for Condition

(0) ShareShare
ReportReport
Posted on by 133

I'm trying to set fields in a canvas app where I have data in two separate SharePoint Online lists but are tied together with a PK of eTASFID & eNDASFID.  I'm using a gallery to set varRecord which captures the eNDASFID and navigates to a separate screen for data input. I've create a collection which does have the data in it bu when I try and set a Text Fields using the varRecord.eNDASFID it returns blank, but if I manually add the number it works just fine.  Not sure what I'm dong wrong so any help would be appreciated.

 

Doesn't work:

LookUp(collectionTASFRecord,eTASFID = varRecord.eNDASFID,eTASFNAICSCode)

 

Works:

LookUp(collectionTASFRecord,eTASFID = "0064z000028IRsN",eTASFNAICSCode)

 

 

Categories:
  • BCLS776 Profile Picture
    8,994 Moderator on at

    Have you tried?:

    With({aRecID: varRecord.eNDASFID},
     LookUp(collectionTASFRecord, eTASFID = aRecID, eTASFNAICSCode)
    )

    That should help ensure the app properly accesses the record within the variable.

     

    Hope that helps,

    Bryan

  • DarenD Profile Picture
    133 on at

    Unfortunately that renders the same way...like there's no record even though there clearly is.  Very frustrating for sure.

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @DarenD,

    Have you solved your problem?

    Could you please tell me that how you create this variable?

     

    Try to set the following to check if the variable is blank:

    If(!IsBlank(varRecord.eNDASFID),LookUp(collectionTASFRecord,eTASFID = varRecord.eNDASFID,eTASFNAICSCode),"eNDASFID Not found")

     

    I think the key to this issue is that the varaible is not triggered successfully.

    Try to set this variable toghther with your Navigate() function:

    Set(varRecord,Gallery.Selected);Navigate(Screen2)

     

  • DarenD Profile Picture
    133 on at

    Qi,

      Thank you for responding!  I tried what you recommended but actually nothing showed, not even the "Not Found" text.  I can see where the collection is being created with the records in it so I know the data is in the collection but for some reason Filter and LookUp are not showing anything.  

     

    Basically I use a gallery on screen 1 that pulls data from one list and in that list is text "187Mzr" for example and it sets varRecord then navigates to screen 2.  I use varRecord to populate various fields and On Visible for screen 2 I set collectionTASFRecord.  On screen 2 I have about 8 fields that need to be set from this collection and "187Mzr" is the filter/lookup criteria used to populate the text fields.

     

    Now if I hand type in the filter criteria it works just fine. Of course this isn't useful or scalable.

    Example: LookUp(collectionTASFRecord,eTASFID = "187Mzr",eTASFType)

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @DarenD,

    Show me your variable, give a screenshot to prove that it is not blank.😂

    And show me the formula how you create this variable.

  • Verified answer
    DarenD Profile Picture
    133 on at

    LOL!! Right! Well I can say that the variable wasn't empty, what it ended up being was that the PK fields didn't match!  When looking at them in SPOL the lower case "L" looked like an "I" but when you put them in notepad I could see the difference.  So there you go, chalk this one up to being blind! LOL!  😳

     

    Qi thank you very much for responding to my comment and helping me troubleshoot!!!

     

    D

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 Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard