Hello PowerApps Guru's. I am stuck on configuring a dynamic radio control. I have a data source (SharePoint List) named "Data1", that has 6 fields. On my Screen I am filtering a gallery with two (2) Radio controls. The first Radio control (Radio1) is pulling from a Choice column named "Type" from "Data1" data source. What I would like to do is have the second Radio control show all the used choices from "Status" field in "Data1" data source. I would also like to show the count of how many "Type's" have of each Statuses ("Status" field). I have included a demo of my data source setup.
Data Source: This shows inventory of items to be checked out
"Data1"
Columns :
"Type" - Choice column, choices are "widget", "thingamabob", "doo-hickey"
"Status" - Choice column, choices are "Available", "Checked Out", "Disposed"
So if I have 3 "widgets" Available, 2 "widgets" Checked Out and 5 "widgets" Disposed. I would like to have the radio buttons look similar to: (underline denotes selected value)
Radio1 - Widgets Thingamabob doo-hickey
Radio2 - Available (3) Checked Out (2) Disposed (5)
I am using the following syntax for Radio2:
AddColumns(
GroupBy(
ShowColumns(
AddColumns(
Data1,
"State",
Status.Value,
"Item",
Type.Value
),
"State"
),
"State",
"Data"
),
"Status Count",
State & " (" & CountRows(Data) & ")"
)
I just need to do a comparison of "Type" from the data source to the selected value of Radio1.
Any suggestions are greatly appreciated.
On a side note, I can get this to work if I do an If statement using CountRows(Filter( for each possible outcome, but would prefer to use this way as it would update dynamically.
Thank you
Solved! Go to Solution.
Yes, slightly misunderstood your request.
You can avoid all the show columns functions, they aren't really going to bring you any value in this.
You will want to get down to one hit at the data rather than doing it over and over in the second radio control.
Set the Radio1 Items property to:
AddColumns(
AddColumns(
Distinct(Data1, Type.Value),
"_stats", AddColumns(Filter(Data1, Type.Value = Result), "_stat", Status.Value)
),
"_statusCounts", AddColumns(GroupBy(_stats, "_stat", "_data"), "_Counts", _stat & " (" & CountRows(_data) & ")")
)
Set the Radio2 Items property to:
Radio1.Selected._statusCounts
Change the Items property of your Radio1 to:
AddColumns(
GroupBy(
AddColumns(Data1,
"_type", Type.Value,
"_status", Status.Value
),
"_type", "_status",
"_records"
),
"StatusCount", _status & " (" & CountRows(_records) & ")"
)
Set the Items property of Radio 2 to: Radio1.Selected_data
This should give you what you are looking for.
I hope this is helpful for you.
Thank you @RandyHayes , this shows the count for Radio1. I need the count to be in Radio2. So Radio1 shows "widgets" and Radio2 will show Available (3) Checked Out (2) Disposed (5).
I am trying to work on your suggestion and I am getting the correct Items listed, but not showing any count values in Radio2.
I did need to modify Radio1 to:
ShowColumns(
AddColumns(
Data1,
"Type",
Type.Value,
"State",
Status.Value
),
"Type"
)
Radio2 looks like:
AddColumns(
GroupBy(
ShowColumns(
AddColumns(
Data1,
"State",
Status.Value,
"Type",
Type.Value
),
"State"
),
"State",
"Data"
),
"Status Count",
Radio1.Selected.Type & " (" & CountRows(Data) & ")"
This shows the correct Status values, but no counts...
Yes, slightly misunderstood your request.
You can avoid all the show columns functions, they aren't really going to bring you any value in this.
You will want to get down to one hit at the data rather than doing it over and over in the second radio control.
Set the Radio1 Items property to:
AddColumns(
AddColumns(
Distinct(Data1, Type.Value),
"_stats", AddColumns(Filter(Data1, Type.Value = Result), "_stat", Status.Value)
),
"_statusCounts", AddColumns(GroupBy(_stats, "_stat", "_data"), "_Counts", _stat & " (" & CountRows(_data) & ")")
)
Set the Radio2 Items property to:
Radio1.Selected._statusCounts
Happy to help. Sorry I misunderstood at first.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
User | Count |
---|---|
162 | |
91 | |
67 | |
63 | |
62 |
User | Count |
---|---|
216 | |
158 | |
96 | |
86 | |
79 |