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 / disable a button throu...
Power Apps
Answered

disable a button through dropdown box from a field in SharePoint list

(0) ShareShare
ReportReport
Posted on by 8

I want to disable a "View Docs" button when the Form selected from the dropdown box has the field 'Show Form' set to No in a choice column. 

 

I have tried using a ForAll to loop through a collection of the SP List, 

 

At this point, I am not really sure of the best way to access the data in the SP List to achieve the results I am looking for.  I am currently taking some courses in Power Apps, but they have not discussed how to do something similar to this yet.

 

I am also trying to filter the collection and then access the values of the collection, but I am having trouble with that as well.  The collection has three string values, but when I try to use them in a condition (e.g. If(DisableFormCollect.ShowData = "No", it says it is a table and there is no Value property.

 

 

Thanks, 

Data example.png
Form example.png
Code example.png
Categories:
I have the same question (0)
  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    Hi @WhitewolfPA123 ,

     

    Could you please try this:

    If(
     YourDropdown.Selected.Choices.Value = "No",
     Disabled,
     Edit
    )
  • WhitewolfPA123 Profile Picture
    8 on at

    Well, It did not work, but I may not understand what is happening.  So, just as a rehash.

     

    With the SharePoint list that i have (shown above), I am putting the "Form Names" column in the drop down.

    As in the image, there is a View Docs button that I want to disable if the Show Data column (Choice) is set to "No".

     

    I have two problems:

    1.  I don't know where the logic should go to test for the "Show Data" column equal to "No"

    2.  I don't know how to access the data for the "Show Data" column in the Share Point list.

     

    I can see the data both in the data source and in the collections, but having a devil of a time trying to compare the data to anything.

     

    So far, i have tried to access the "Show Data" in various iterations of a collection, but it keeps being referred to as a table and not a "Text" or "String".

     

    I last question, for now, is what does the "Choices" in your code stand for?  I don't see anything in the intellisense for it so i assume I am suppose to substitute something for it?

     

    Sorry, so noob.  Working to change that... 🙂

     

    Thanks

  • PTBBSolutions Profile Picture
    691 on at

    Hi @WhitewolfPA123 ,


    We are all here to learn 🙂

     

    To test, you can throw a label on your screen and adjust it's text property to [DropDownControlName].'Show Data'.Value - this should change the value in your label as you change the selection in the drop down.

     

    The snippet I gave you earlier you go on your View Docs button's DisplayMode property.

     

    The Choices in my code represents my SP choices column (the equivalent of yours "Show Data") - sorry for this.


    Let me know if it works 🙂

  • WhitewolfPA123 Profile Picture
    8 on at

    Maybe I have messed up from the start, what data source do I put in the dropdown in order to be able to see the 'Show Data' choice column in my SharePoint list.  I don't see it in the Intellisense and get an error when I try to add it to the text box. 

     

    This may be my root problem...

     

    Thanks for your patience and help.

  • PTBBSolutions Profile Picture
    691 on at

    In the dropdown, in the Items property you put your SharePoint list name. After that in the Value property of the same dropdown, you put your display column (in your case it will be "Form Names" or if you are using the default column, it will be called Title - please note that even you are using the Title column from SP, even if you have renamed it, PowerApps will still see the old name.) After that you put my code in you button OnDisplay property.

     

    One clarification - is your SP column a Choice column or a Yes/No Column?

  • WhitewolfPA123 Profile Picture
    8 on at

    Thanks, I was all turned around.  All the tutorials I have taken have not covered this, plus I was actually using a combo box instead of a dropdown.  Once I got that straight and looked at your first answer (in conjunction with your explanations) it made perfect sense.  So, I accepted your first answer, and hopefully people will read the explanations to understand it.  It works perfectly!!! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard