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 / ThisItem Null for 1 va...
Power Apps
Unanswered

ThisItem Null for 1 value on gallery open

(0) ShareShare
ReportReport
Posted on by 56

I am having a strange issue with a gallery that is the main/first screen presented when the app is opened.

 

The issue is this:

1) Sharepoint list with existing data - many attributes, but there is a uid number field used as the primary key.

2) The UID is used to lookup an image from a sharepoint document library.

3) When the app is opened, the first row of data has the ThisItem.uid set to null: well, Len( Text( ThisItem.uid ) ) = 0.  Other attributes - text attributes are set and display correctly.

 

In the image below, I created a text box to debug and... when opened, first record is selected ( by default by powerapps ), but the uid and therefore the lookup is empty.

 

coyote_ptm_0-1627058823165.png

 

After I select another record of the gallery the uid and lookup fill. 

coyote_ptm_2-1627059207110.png

 

The image display uses the lookup to display the correct image in the gallery.  It appears the image is only actually looked up on screen initialize because after selecting another row, the image in row 1 is still blank - even when the lookup value is filled.

 

I've also tried sorting DESC since the first uid = 0, but I still get the same issue.  The first record will be blank until another is selected.

coyote_ptm_3-1627059660661.png

 

A final note, I tried wrapping ThisItem.uid in Text( ) and same result.  It seems ThisItem is handled as text, but I'm unsure.

 

Hopefully this is something easy - but I'm fairly baffled?!

 

Categories:
  • GarethPrisk Profile Picture
    2,828 on at

    I have encountered this before, as well. It's finicky, and likely an obscure bug. I am asking my colleagues about how we resolved it in the Dataverse for Teams apps, but no response yet.

    A few things to try:

    • Set DelayItemLoading to true on the Gallery
    • Simply the LookUp for the Image
      • What is the code without the troubleshooting elements?
    • Try adding a Select(GalleryName) or Reset(GalleryName) for the screen's OnVisible

    Wish I had a more concrete fix. Good luck!

  • coyote_ptm Profile Picture
    56 on at

    Thanks for the quick feedback.  I'm thinking it's an obscure bug also - frustrating since the page looks so good with the other images.  I did try the 3 things you mentioned to no avail.

     

    The code to display the image in the gallery is:

    LookUp(
     proposal_images,
     is_folder = "N" And StartsWith(
     '{FullPath}',
     "proposal_images/proposal_" & Text( ThisItem.uid ) & "/"
     ) And is_preview = "Y"
    ).'{Thumbnail}'.Large

     

    The sharepoint document library has an "is_preview" attribute that we set to show that it's the image to display as a preview.  Works great.  Well... except for record 1.

     

    If I figure something out, I'll update this post.

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 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard