How to Sort Power Apps Radio Button?

Do you have a requirement where you want to sort the Power Apps radio button control values in ascending or descending format? If yes! Follow this complete tutorial.

This Power Apps tutorial will explain “How to sort the Power Apps Radio button.

Sort Power Apps Radio Button Alphabetically

Let me check how to sort the Power Apps radio button values alphabetically in two different scenarios:

  1. Sort Power Apps Radio Button Items [Manually]
  2. How to sort Power Apps radio button values [using a SharePoint list]

Sort Power Apps Radio Button Items Manually

For example, I have created a Power Apps Canvas app and then added a Radio button control that contains the “Employee Names” [Which I added manually].

How to Sort Power Apps Radio Button

Next, I want to arrange these Radio button values in ascending order [A to Z], as in the screenshot below:

How to Sort Power Apps Radio Button Control

To work around this, follow the below steps:

  • Open your Power Apps with respective Microsoft credentials.
  • Create a Power Apps Blank canvas app -> Then add a Radio button control -> Set its Items property to:
Sort(
    [
        "Aiden",
        "Anthony",
        "Emma",
        "Emily",
        "Lily",
        "Blair",
        "Liar"
    ],
    Value,
    SortOrder.Ascending
)

Where,

  1. “Aiden,” “Anthony,”Emma,” etc… = Power Apps Radio Button Items
How to Sort a Power Apps Radio Button
  • Save, Publish, and Preview the app. The Power Apps Radio box will display the records based on the ascending order, as shown below:
Sort Power Apps Radio Button Alphabetically

This is how to sort a Power Apps Radio button value in ascending format.

How to sort Power Apps radio button values using a SharePoint list

Let me show you how to sort the Power Apps radio button items in a descending format connected to a SharePoint list.

For example, I have a SharePoint Online list[ “Diseases List”] that has various columns like:

Column NameData Type
DiseaseTitle
Doctor’s NameA single line of text
Doctor’s FeesCurrency
Sort SharePoint List Filed in Power Apps Radio Button

I created a Power Apps canvas app and added a Radio button control and a Sort icon. The radio button is connected to the above SharePoint list title column.

Whenever the user clicks on a sort icon, the Power Apps radio button value will be sorted in an ascending or descending format as shown below:

Power Apps sort radio button values using SharePoint list

To achieve it, follow the below steps:

  • On the Power Apps Screen -> Insert a Sort icon -> Set its OnSelect property as:
Set(
    varColumn,
    "Title"
);
Set(
    varOrder,
    If(
        varOrder = SortOrder.Ascending,
        SortOrder.Descending,
        SortOrder.Ascending
    )
)

Where,

  1. varColumn = 1st Global Variable Name
  2. Title = SharePoint list column name
  3. varOrder = 2nd Global Variable Name
How to sort Power Apps radio button using SharePoint list
  • Insert a Radio button control -> Set its Items property to the code:
SortByColumns(
    'Diseases List',
    varColumn,
    varOrder
)
Sort Power Apps radio button using SharePoint list
  • Once your app is ready, Save, Publish, and Preview the app. The radio button values will be sorted in an ascending or descending order whenever the user clicks on a sort icon, as shown below:
Sort radio button using SharePoint list in Power Apps

This is how to sort Power Apps radio button values using a SharePoint list.

Conclusion

I trust this Microsoft Power Apps tutorial taught all the information about how to sort a Power Apps Radio button value in an ascending or descending format.

Also, you have learned to sort Power Apps radio button values using a SharePoint list.

You may also like: