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 / Create radio button to...
Power Apps
Answered

Create radio button to filter a a gallery

(0) ShareShare
ReportReport
Posted on by 691

.

 

Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @s44 ,

    Try The Code like this

    Set the OnCheck property of the "Actif" radio button to:

    Set(FilterStatus, "Actif")

    Set the OnCheck property of the "Inactif" radio button to:

    Set(FilterStatus, "Inactif")

    Then, set the Items property of the gallery to:

    Filter(YourDataSource, Statut = FilterStatus)

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali 

  • Hii_iii Profile Picture
    691 on at

    .

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @s44,

     

    The following changes should do the trick. The code below assumes that you are using Dataverse.

     

    (1) Change radio button Items property to

    ["Actif"; "Inactif"]

     

    (2) Change the Items property of your gallery to:

    With(
     {
     //Map the selected value to the correct choice list option
     //In Dataverse your default Status column is a local choice list within that table
     wStatut: Switch(
     Radio2.Selected.Value;
     "Actif";
     'Statut (JOURNAL_BY_PASS)'.Actif;
     "Inactif";
     'Statut (JOURNAL_BY_PASS)'.Inactif
     )
     };
     Filter(
     'JOURNAL_BY_PASS';
     IsBlank(Radio2.Selected) || Statut = wStatut
     )
    )

     

    Alternatively, to avoid the choice list mapping you could use a Dropdown control with the following Items property:

    Choices('JOURNAL_BY_PASS'.Statut)

    (You can allow empty selections by setting 'AllowEmptySelection' to true)

     

    Your gallery items property would be:

    Filter(
     'JOURNAL_BY_PASS';
     IsBlank(Dropdown.Selected) || Statut = Dropdown.Selected.Value
    )
    

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Verified answer
    M_Ali_SZ365 Profile Picture
    1,110 on at

    @s44 ,

    Try this Code

    Items property of your radio button control like this:

    ["Actif", "Inactif"]

    Gallery Items property:

    Filter(
     'JOURNAL_BY_PASS',
     IsBlank(Radio2.Selected) || Statut = If(Radio2.Selected.Value = "Actif", 'Statut (JOURNAL_BY_PASS)'.Actif, 'Statut (JOURNAL_BY_PASS)'.Inactif)
    )

    Fuel our success! 🚀 Give a thumbs up and click 'Solution Accepted' to supercharge our community. Your actions speak volumes!
    Warm regards,
    Muhammad Ali

  • Hii_iii Profile Picture
    691 on at

    .

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
Kalathiya Profile Picture

Kalathiya 419

#2
WarrenBelz Profile Picture

WarrenBelz 397 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 345 Super User 2025 Season 2

Last 30 days Overall leaderboard