Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Capture and Use Unique ID

(0) ShareShare
ReportReport
Posted on by 4,704 Super User 2025 Season 1

The screenshot below has Gallery1 in which is TextInput1
that contains the 'Unique ID'. I have added a button in
Gallery1 I could use ThisItem language to capture Gallery1
data for use in another screen.

Is it possible to write a variable in the 'Client Attachments'

button on the left margin that capture the 'Unique ID' from

Gallery1 and then use that variable to auto-populate the

default state of a ComboBox in the second screen?

Phineas_0-1707416804166.png


Auto-populate Gallery1 'ID' field content from above into

ComboBox below.

Phineas_1-1707417247277.png

 

Categories:
  • Verified answer
    Michael E. Gernaey Profile Picture
    41,254 Super User 2025 Season 1 on at
    Re: Capture and Use Unique ID

    Hi @Phineas ,

     

    I will show you but also explain it can be done a little different just for learning purposes.

     

    Also your code for your combo is confusing because you are doing a Distinct, which works on an entire field, so you will get multiple results and something normally for the items property.

     

    For Screen 2 are you trying to Select the Default item/Selected Items of the ComboBox based on the ID from Screen 1(Gallery 1)??. Thats different then saying populate a combo box with (selectable items) AKA the items property.

     

    Which one do you want??? a Default selected based on Screen 1 or the Items property filled based on Screen 1??

     

    That side for a moment lets talk about passing the data to Screen 2

    1. you do not need to capture the value in a variable at all. When you do that, especially since you are making it Global, its automatically available everywhere.

     

    Treat this value as a Context value from screen to screen.

    So dont use the global variable, just do this

    Navigate(Screen, Transition, { IdToSendToScreen2: Gallery1.Selected.IdColumn })

     

    Now in screen 2, use the (I made it up) Context Variable IdToSendToScreen2, inside the items formula or the Default/DefaultselectedItems formula to auto populate the selected item.

     

    and now you dont need to use a global variable.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard