cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerapps890
Post Prodigy
Post Prodigy

Count when RadioButton is Selected

I want to have a counter that decreases by one whenever a radio button is selected in the gallery. Currently the one I have works, but it resets whenever the app is closed. My app brings in previous responses with a lookup. How can I get the counter to stay at what it was previously at? If I reopened the app and submitted 10 radio buttons last time it would still say 46. Also, instead of me saying their are 46 radio buttons is there a way it could countRows of blank radio buttons. In my onselect for my counter I have Set(varRadioButtonSelectedCounter, 46); In the onchange for the radiobutton I have Set(varRadioButtonSelectedCounter, varRadioButtonSelectedCounter - 1); The default of the radio button is If(var,"",
LookUp(GUATResponses, Title=vUserMail && GUATListID=ThisItem.ID, RadioValue) . The text label of the counter is varRadioButtonSelectedCounter
) .

1 ACCEPTED SOLUTION

Accepted Solutions

@powerapps890  If the previous user entries are overwritten/updated the date is not relevant anymore for this. Could you try with a simple CountIf(GUATResponses, Title = vUserMail)

View solution in original post

19 REPLIES 19
TJO
Resolver II
Resolver II

@powerapps890 Not sure if I completely understand your issue. Variables are all blank upon starting an app. I'd suggest you either patch/update your external datasource upon closing the app/submitting responses (e.g. in a one row table) or use a hidden label inside the app that stores the current value; and retrieve it either from the external table or text label upon opening the app.

 

How do I do this? Like I said ListData has the patched values and looks them up when you reload the app. So i need to include these in the count @TJO . I just want the label to count how many buttons their old total and count it down every time a radio button is selected. 

@powerapps890  It's a bit difficult to understand your issue...could you show a screenshot of the table to be patched and one from the app with the counter on it?

Capture.PNGCapture3.PNG@TJO 

@powerapps890  So if I get this right, is this per user...each user has 46 radios to check and the 4th column of your 1st pic (rows 1- 😎 mean it is the input of the user # 1?

 

And in your data table...is there a row for each user and each radio selection?

Well this only has mock data the user will actually have 1000 and which table @TJO 

The data is pulled by the users email so it is on a a user by user basis @TJO 

@powerapps890  Is see, so each user has a set of 46 rows for each session/submit, and each user may have multiple submissions?

 

I guess you need to use a relatively complex lookup or create a collection. Does each data row have the submit date?

Yes the date is attached to each row. Yes, they can submit multiple times because it removes the data and then updates it when the submission button is pressed. @TJO 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,008)