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 Apps / How to reference varia...
Power Apps
Answered

How to reference variables from what was fetched from Sharepoint List

(0) ShareShare
ReportReport
Posted on by 154

Hello,

 

Sorry for the newbie question...

 

I have a gallery that correctly pulls records that contain fields A, B, C, and D from my Sharepoint list called Equipment.  PowerApps auto-built an item detail screen that is forms based and sticks the variables in it in a form.  When I click on the gallery item the command Select(Parent) takes me to the detail screen. 

 

Is there another way that I can directly reference the values in fields that were pulled the Sharepoint list for the current record?  I don't want to use a form, but would very much like to be able to test and compare the variables on this new screen.

 

...and can someone give me a simple explanation of what Select(Parent) does?  I've tried to understand what this does, but I don't get it.  I just want to be able to manipulate the fields in what ever record is selected from my gallery on a new page.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    @AaronTheYoung 

    The easiest way to reference a gallery record throughout your app is to put it into a GLOBAL variable, ie

    // OnSelect of your gallery
    Set(vCurrentRecord, ThisItem);
    
    // If you also wish to Navigate to another screen after the above, add
    Navigate(Screen2, ScreenTransition.CoverRight) // use your screen name and preferred transition method

    You can then access 'vCurrentRecord' anywhere, eg in a Form, insert a Label and use vCurrentRecord.Column1, etc

     

    Select(Parent) is generally used when Galleries are created and you will see then on the Right Chevron '>'. This just means "select this gallery item' or 'this is the selected gallery item', etc. If you were to add the above code to your gallery OnSelect then Select(Parent) would also set vCurrentRecord to ThisItem. You don't really need this code if your gallery has OnSelect code as it's just doubling up.

     

     

  • AaronTheYoung Profile Picture
    154 on at

    So then I can reference each field in the record by ThisItem.A, ThisItem.B, etc?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    @AaronTheYoung 

    You would use vCurrentRecord.A, vCurrentRecord.B, etc

     

    ThisItem is reserved for Forms and Galleries so wouldn't work outside of these.

  • AaronTheYoung Profile Picture
    154 on at

    Hmmm.... vCurrentRecord.Equipment isn't valid.  This identifier is not valid.  Equipment is the first field in my record.  

  • AaronTheYoung Profile Picture
    154 on at

    Cool. It's working now. My new code just needed to be acknowledged everywhere.  It seems sometimes that PA is slow to code changes like this.

     

    Thanks for your help.  I'm over this hump and can move ahead with this app!

     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard