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 / Add choice to radio bu...
Power Apps
Answered

Add choice to radio buttons after filtered table

(0) ShareShare
ReportReport
Posted on by 75

Hi all,

 

I want to have a choice added to a set of radio buttons that are currently displaying a set of records.

Basically, my "items" are using a data source to display a dynamic amount of entries:

 

Filter(source;column1.Value = "example";"searchText" in column2.Value).column3

 

 

This gives me the following choices:

  • Choice 1
  • Choice 2
  • ...

What I want to have now, is to add a separate choice to the existing list, that always shows at the end:

  • Choice 1
  • Choice 2
  • ...
  • none of the above

I've tried using the "table" function, but this doesn't work and gives me a syntax error.

How can I achieve this?

Categories:
I have the same question (0)
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello @_n_MarianLein ,

     

    The way I achieved this was by putting the code in a separate "OnChange()", "OnVisible()" or "OnSelect()".

     

    I would use "ClearCollect()" to add all the filtered data inside a local collection, then follow up with a "Collect()" to add a final default value to the collection.

     

    Then the gallery would exploit the newly made collection to display all filtered data plus the default value.

     

    Hope this is helpful to you.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @_n_MarianLein 

    Or you could hard code it.

    ["Choice1","Choice2" ,"...","None of the above"]

  • _n_MarianLein Profile Picture
    75 on at

    Not an option.

  • _n_MarianLein Profile Picture
    75 on at

    @WiZey  How would this actually look, though? I don't understand the concept, yet.
    Can you please share a code sample?

  • Verified answer
    WiZey Profile Picture
    3,023 Moderator on at

    Basically, the code would look like this when re-using your "Filter()":

     

    ClearCollect(cltOptions;Filter(source;column1.Value = "example";"searchText" in column2.Value).column3);;
    
    Collect(cltOptions;{column3:"None of the above"})

     

    The first "ClearCollect()" would create this list:

     

    • Choice 1
    • Choice 2
    • ...

     

    The second "Collect()" would then add the last item, effectively creating this list:

     

    • Choice 1
    • Choice 2
    • ...
    • None of the above

     

    However, the code would need to appear in a "OnSelect()" or a "OnChange()" to be usable.

    For example, you could put this code in the "OnVisible()" of your screen to create the collection when the user arrive on the screen, or in the "OnSelect()" of the button which load or refresh the data. 

    I don't know how your app was built, so I can't really suggest more precise ideas.

     

    I hope this was helpful to you.

  • _n_MarianLein Profile Picture
    75 on at

    Thanks, this was exactly what I needed - On the "items" section of my radio buttons, I was then able to use cltOptions.column3 to display the correct choices.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#2
11manish Profile Picture

11manish 192

#3
Valantis Profile Picture

Valantis 128

Last 30 days Overall leaderboard