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 / Show/hide a component ...
Power Apps
Unanswered

Show/hide a component with a button

(1) ShareShare
ReportReport
Posted on by 25

Hi !

 

I'm trying to do something like this:

- A screen is loaded with a datatable invisible;

- The user fill a textinput with something he wants to see;

- When clicking a button, the datatable will show and filter that textinput term digited.

 

I'm trying first just to make a button that shows that table, so, i let the datatable visible option in off:

image.png

 

and in the button onselect, i tried:

 

image.png

 

But, when i run the application and click on the button, nothing happens. The table doesn't show up. 

Any help?

 

 

Thank you ! 

 

Categories:
I have the same question (0)
  • Verified answer
    dinusc Profile Picture
    Microsoft Employee on at

    The reason it does not work is because your DataTable4.Visible property it is set to "false" so your button action is simply ignored. What you need to do is to set it to a variable ans then set that variable by your button action:

    Screen1.OnVisible=Set(v.false)

    YourButton.OnSelect=Set(v, true)

    DataTable4.Visible=v

    The first formula will set the visibility to false by default every time you navigate to your screen.

    Clicking on a button will set it to true and the DataTable visibility is bound to the visibility variable.

  • Karl_Hirschle Profile Picture
    25 on at

    Thank you !!!!!

  • Karl_Hirschle Profile Picture
    25 on at

    Hi ! I'm still having problems. The show/hide suggestion worked very well !

    As i said, i want too to filter the data.

     

    I have a textinput called "pesquisa" and a datatable called DataTabel1 that has two collumns: "colaborador" and "capacitacao

     

    I tried insert/datatable and, on button select, i wrote:

    Set(b, pesquisa.Text);
    Filter(capacitacoes_dados_teste, b in colaborador) but the debbuger returns me a error saying "expected a text value" instead of colaborador. But this is the name of my column. Some help?

  • dinusc Profile Picture
    Microsoft Employee on at

    This is most likely because colaborador is a record. Try to type a "." after it to see if intellisense provides value names for you.

    Your formula has to be something like

    Filter(capacitacoes_dados_teste, b in colaborador.Value)

  • Karl_Hirschle Profile Picture
    25 on at

    Doens't worked 😕

    .value isn't available.

  • Karl_Hirschle Profile Picture
    25 on at

    I tried another column and this error appeared:

     

    Sem título.jpg

  • dinusc Profile Picture
    Microsoft Employee on at

    Just so I understand, you have a data source "capacitacoes_dados". That data source has a column "colaborador". You also have a DataTable with 2 columns: "colaborador" and "capacitacao".

    You also have a button and a text field. What you want to do is to fill the DataTable control with the data from your source (capacitacoes_dados) which is filtered by the "colaborador" column based on the text value from your text field. If so then the following should work:

    YourButton.OnSelect=Set(col, Filter(capacitacoes_dados_teste, pesquisa.Text in colaborador))
    DataTable1.Items=col

    The reason you see the delegation warning is most likely because of the "in" operator that cannot be delegated by your source connector. What this means is:

    If your source contains more records than the maximum allowed by the connector (500 by default that can be changed to 2,000) then you may not get the proper results. If you have less records then you may safely disregard the warning. If you have more records then you will have to ensure that you use only delegable functions and operators in your formula. Please see more details here:https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-list

  • Karl_Hirschle Profile Picture
    25 on at

    Exactly what you said !!!

     

    Datatable.items isn't available and the software gives a error on colaborador, saying: Expected text value.

  • dinusc Profile Picture
    Microsoft Employee on at

    ok. Let's start with the first issue: "Datatable.items isn't available"

    Please see the screenshot below. Do you see the "Items" property in the Advanced Properties panel?Capture.PNG

     

     

  • Karl_Hirschle Profile Picture
    25 on at

    Is configured this way:

    kjekdjke.png

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard