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 give default va...
Power Apps
Answered

How to give default value for drop down from gallery

(0) ShareShare
ReportReport
Posted on by 243

I'm trying to give default value for drop down from gallery selected text.

I added data source as Name for drop down and for this default name should be displayed from gallery

I tried doing look up but it's not showing selected name in gallery

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    On the OnSelect of the Icon or button inside the Gallery Set a variable;

    Set(MySelected, Gallery1.Selected.YourColumnForDropdown)

    Then in the Default of the dropdown put:

     MySelected

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • SumanKoduri Profile Picture
    243 on at

    this is my items for drop down 

    [1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025, 2026, 2027, 2028, 2029, 2030, 2031, 2032, 2033, 2034, 2035, 2036, 2037, 2038, 2039, 2040, 2041, 2042, 2043, 2044, 2045, 2046, 2047, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 2057, 2058, 2059, 2060, 2061, 2062, 2063, 2064, 2065, 2066, 2067, 2068, 2069, 2070, 2071, 2072, 2073, 2074, 2075, 2076, 2077, 2078, 2079, 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2087, 2088, 2089, 2090, 2091, 2092, 2093, 2094, 2095, 2096, 2097, 2098, 2099, 2100] 

    I'm trying to give default value from gallery selected year but it is showing first record now when I assign variable in default

     

     

  • SumanKoduri Profile Picture
    243 on at

    Text(date,"[$-en-US]yyyy")

     

    I gave like this now it is showing default date as 2020

  • SumanKoduri Profile Picture
    243 on at

    sorry when i give variable from gallery to drop down it is showing first record still for name

  • eka24 Profile Picture
    20,923 on at

    Can you show the variable in the Gallery. I tested it at my end I didn't get error

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • KrishnaV Profile Picture
    5,023 on at

    Hi @SumanKoduri ,

     

    Step1: Ensure that the gallery items are part of your dropdown list items

    Step2: Set the default value of the dropdown with variable (ex: varGalSelectedTitle)

    Step3: update the variable value as part of the gallery selected property
    ex: UpdateContext({varGalSelectedTitle:Gallery2.Selected.Title});

     

    See the below for your reference:

    Dropdown Default Value.gif

     

    Note: if this helps mark it as the solution.

     

    Regards,

    Krishna

  • SumanKoduri Profile Picture
    243 on at

    It's working, but in my case I've only id in my table and in drop down am displaying Name so based on Id i need to display name

    when i try to use lookup it's not showing name for selected Id from gallery

  • Verified answer
    KrishnaV Profile Picture
    5,023 on at

    Hi @SumanKoduri ,

     

    First thing first sorry for the late reply.

    Here is the working model to show the default dropdown value with the selected ID in the gallery:

    Default value for drop down from gallery with ID.gif

     

    And the formula for the dropdown is as follows:
    for items: 

    Distinct('Employee Details'.Title,Title)

    for Default value: 

    LookUp('Employee Details',Title=Gallery5.Selected.Title).Title

     

    Hope that works, please let me know if you see any further issues.

     

    Regards,

    Krishna

    If this reply/solution helps Mark as the solution and give a thumbs-up.

     

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