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 / OnSelect button not wo...
Power Apps
Answered

OnSelect button not working on existing items

(0) ShareShare
ReportReport
Posted on by 12

Hello. I want to customize a form in SP by dividing my fields in two dropdown Lists, thus I added a button for each section and set the OnSelect property to:

  • Set(varshowfields, If(varshowfields=1, 0, 1) )

The button works perfect when adding a new item, but with existing items, it doesn't work. Any idea of how to implement it to work both in existing and new items?

 

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @casr133 ,

     

    Could you please share more details about your scenario? What do you mean by dividing fields in two dropdown lists?

     

    Maybe you can try UpdateContext({varshowfields : !varshowfields}) instead. And OnStart needs UpdateContext({varshowfields : true) to initialize this variable as true/false.

     

    Best regards

  • casr133 Profile Picture
    12 on at

    I have a List with over 200 fields, thus, I want to minimize the length of the form by adding headers/sections, which, when clickable, will display the fields  aggregated to that header/section. Just like an accordion. I created the buttons and it works perfect on new items (edit mode). However, once I have created a new entry, if I try to open it, I cannot click on the headers to display the corresponding fields (view mode). A solution I found was to add the buttons outside the form, that way, they are clickable even in view form, but the problem is that the position of each button is fixed and consequently every time I open a specific header, the button doesn't move accordingly.

     Thanks in advance.

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @casr133 ,

     

    This scenario called tabbed form, please refer to below blog or you can search for it on the web.

    Best Way To Create Power Apps Tabs Control - Tabbed Form In PowerApps | Power Apps (devoworx.net)

     

    So, generally speaking, we will use a Gallery to include the tabs, which will make those buttons independent to display mode of forms, and also easier to adjust their appearance.

     

    Best regards,

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 477

#2
WarrenBelz Profile Picture

WarrenBelz 341 Most Valuable Professional

#3
11manish Profile Picture

11manish 317

Last 30 days Overall leaderboard