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 / How to set a variable ...
Power Apps
Answered

How to set a variable and how to call it and how to do a lookup on a SharePoint list as well!

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Everyone,

  

Can someone help me with this:

 

- I have a lookup function on an arrow in a gallery:

Set(MyVar,LookUp(FP20SPowerAppFlowTest,Title1 = FP20SPowerAppFlowTest})

- OnSelect of that arrow I want it to read the label to the left of the arrow (in the gallery) and then set it to another label elsewhere on the slide. I've just managed to work out how to set a variable and write it to another label but how do you combine the vlookup with setting of the variable?

 

- Is there something wrong with my lookup (I'm presuming there is!)

 

 

Thanks as ever.

Categories:
  • v-yamao-msft Profile Picture
    Microsoft Employee on at

    Hi cardinalpipkin,

     

    About set function, we can use set function to set the value of a global variable. Please check more details about Set function at here, the examples for the function in this doc could be a reference for you:
    https://powerapps.microsoft.com/en-us/tutorials/function-set/

     

    About Lookup function, it seems that there is something wrong with the function you are using.

     

    Please try to configure the function to something likes below:
    LookUp(List1,Title="kk",ID)

     

    More details about Lookup function, please check it at here:
    https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

     

    Please feel free reply if you need more help.

     

    Best regards,
    Mabel Mao

  • Verified answer
    Delid4ve Profile Picture
    795 on at
    Get rid of the } and in its place put a comma then field name you want returned from the lookup and then another )

    If it's from a gallery you can use:
    Set(MyVar,GalleryName.Selected.FieldName)
    You can then just set the text box Text on the next page to MyVar
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Mabel,

     

    That lookup seems to only lookup "kk" but I want it to lookup whatever is in a particular label in the gallery I have. I want it to look it up on a sharepoint list I have connected when I click the arrow next to the label in the gallery.

    fdgh.PNG

    I'm not sure a lookup is any good to lookup a value from a SharePoint list. Are there any other functions to do this?

    My connection is called FP20SPowerAppFlowTest.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    That doesn't seem to work:

     

    Set(MyVar,Gallery1.Selected.Title1)

     

    It's giving me the red wavy line underneath it

     

    EDIT: So that now works after it crashes and I restart it. Many thanks.

     

    Regards,

     

    C

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 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard