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 / Accessing Sharepoint L...
Power Apps
Answered

Accessing Sharepoint List Item ID from Screen (instead of Form)

(0) ShareShare
ReportReport
Posted on by 23

I have a custom Sharepoint PowerApps form that I've added some fields to within the Screen, but outside of the standard EditForm for the list. I'd like to access the Sharepoint List Item ID from the Screen level when editing an item from the list so that I can load pertinent information from a secondary list that uses the Item ID as a foreign key.

 

I've tried adding the ID field to the EditForm and then referenceing the field's content on the Screen's On Visible action, but think it might run that code before the ID field is assigned its value by the form.

 

I've also tried using the SharepointIntegration.SelectedItemID, but this isn't returning the value either.

 

Is this even possible?

 

 

Categories:
I have the same question (0)
  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Yes. You didn't ask the question the way I expected so maybe I am confused but I don't think so.

     

    Within the form you can reference ThisItem.ID to get the ID you are looking for. 

     

    In this video PowerApps LookUp Column functionality I cover a lot of fun stuff which it sounds like you are digging into.

  • gmcanally Profile Picture
    23 on at

    Thanks for the reply. ThisItem appears to be within the scope of the Form, but not the Screen that the form is in.

     

    I've attempted to refer to ThisItem at the Screen level, but it's not a recognized object,

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Okay. That is correct sorry if I missed that the first time. 

     

    Can't you put your dropdown on the form to avoid this issue? Just add a custom card and you can do whatever you would like. 🙂 Maybe a bit more context on what you are hoping to do?

     

    Back to your more direct question. I put this in a Label outside of the form and it shows fine for me. 

     

    SharePointIntegration.SelectedListItemID

     

    That is slightly different than what you typed? Maybe a typo getting you?

  • gmcanally Profile Picture
    23 on at

    On the Screen that contains the EditForm for SharepointList1 I have a Data Table (List2Data) that I need to populate with data from SharepointList2 when the Screen loads.

     

    In the On Visible event I have the following as example code:

     

    ForAll(Filter('SharepointList2',List1_ID = SharePointIntegration.SelectedListItemID),Collect(List2Data,{Id:ID,Description:Title,...}))

     

    When assigning SharePointIntegration.SelectedListItemID to a random field to see what's returned I get only the number 1. There is not an item on the list with that ID number.

     

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Interesting. I don't think the data table works here. I tried something similar with a gallery and it works fine. 😞 Not saying that is a final issue but I am walking out the door and that is where it ended. The Data Table doesn't work the Gallery does. 

  • gmcanally Profile Picture
    23 on at

    I'm a somewhat confused by this. I just tried a gallery and it made no difference. the code above relates to a collection that the Data Table (or Gallery) is associated with. The collection is empty because the Item ID appears to be inaccessible. What did you do with the gallery to make it work?

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Ignore this one and look below. The problem is the text doesn't have a color. 

     

    Long answer coming.

     

    1. SharePoint clicked customize form in PowerApps (or whatever it says)
    2. Resized SharePointForm1 so it took up less space
    3. Added a label on the screen and set the value to SharePointIntegration.SelectedListItemID
      1. It shows the correct ID 🙂 
    4. Added a data connection to the SharePoint list Employees
    5. Added a DataTable to the screen and set its Items to Filter(Employees, ID = SharePointIntegration.SelectedListItemID)
      1. Choose the Title column (all columns are blank but just to be sure)
      2. It is always blank 😞 
    6. Changed the DataTable to be Items = Filter(Employees, ID = 1)
      1. Hardcoded, still blank 😞 
    7. Added a gallery and set Items to Filter(Employees, ID = SharePointIntegration.SelectedListItemID)
      1. Changed the text label in the gallery to be ThisItem.Title  
        1. It shows one record like it should 🙂 

     

    Does that help? The Gallery always works for me. The Data Table never does.

  • Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    Wait @gmcanally I figured it out. 

     

    This is dumb. Basically, when you add a datatable all of the properties are blank. So it is showing you the items but it has no value for the color. Change Selected Color to Black and you will see your text. SIGH. 😞 

  • gmcanally Profile Picture
    23 on at

    Ah, I see the disconnect. 

     

    My data table isn't tied to a sharepoint list, but to a collection. I'm trying to load a filtered list into a collection. This is so the collection can be edited and only patch the entire list with all of the changes in the collection on form submit success rather than as the list items are changed.

     

    The filtering on Item ID and Collect needs to be done when the Screen is launched, but the timing of the Screen's OnVisible action appears to have an issue such that SharePointIntegration.SelectedListItemID doesn't return the expected value.

     

    It's when I'm referencing SharePointIntegration.SelectedListItemID that's the problem. I'm not sure where else I can do this filtering that will have the same effect.

  • Verified answer
    Shanescows Profile Picture
    2,218 Most Valuable Professional on at

    What if you have OnVisible start a timer for 1 second. Then when the timer is done do your collect. Maybe that way your ID will be ready to go by then? 

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard