cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Collect Radio button value from a gallery

Hello,

 

I created a gallery with a list of questions (the number of the questions depends of the survey you selected in a previous screen). I've also included, in this gallery, some radio buttons (OK, NOK and NA). And, at the end of this survey, you have to press on a button to collect all these datas (Questions and answers).

 

Here is my issue:

I would like to know if it's possible to collect some specific datas from this gallery without using 'Gallery.AllItems'? I would be to get something like this:

ClearCollect(Collection,{Surveys:Label3.Text,Question_Num:Label2.Text,Question:Title10.Text,Answer:Radio.  ???  })

 

My final goal, by pressing the button, is to check that the user reply to every question (but I cannot do it question by question seeing that the number is variable). If it's the case I save the datas otherwise I put an error message.

 

Thanks in advance

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Re: Collect Radio button value from a gallery

@Djuls 

 

Can you please try to modify your expression as:
 
Clear(Collection_Test), ForAll(Gallery_Questions.AllItems,Collect(Collection_Test,{Question:Label_Question.Text, Answer: Radio_Answer.Selected.Value}))
This will create a collection iterating over all the items in your gallery control.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Super User
Super User

Re: Collect Radio button value from a gallery

@Djuls 

For that, based on the collection you have now, you can sum the values:

   If(Sum(Collection_Test, If(IsBlank(Answer), 1, 0)) > 0, "unanswered questions", "all answered")

This will sum the values of the Answer column - 1 if it is blank and 0 if it is not blank.  If the sum is greater than 0, then there are blank/unanswered questions.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

6 REPLIES 6
Highlighted
Super User
Super User

Re: Collect Radio button value from a gallery

@Djuls 

To get exact on this solution I would need more specific information from you on your App and controls and so forth.  So, I will be somewhat generic in the response.

Let's say you have your Gallery (Gallery1) and it has the Radio control on it (Radio1).  Let's say your Gallery has an Items property that includes a table which has a column in the record called "Question".

With the above, you can get the specific value with this formula:

   Lookup(Gallery1.AllItems, Question="some question text").Radio1.Selected.Value

 

You can work that into your app and if you have some specific problems, post back with more details.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: Collect Radio button value from a gallery

Thank you for you prompt reply.

 

I tried your solution but it did not work. Please, let me include some printscreens (I make as simple as possible by now, just want to collect the question 'Label_Question' and its value from radio button 'Radio_Answer' [even if user didn't replied]). When I use your proposal, I only get the last question that user replied and nothing for the answer.

So the user, after having selected the specific survey, have to reply to different questions (the number depends of the surveys you chosed). For each question, you have the choise in between 'Yes', 'No' and 'NA'(Not applicable). When user finish to populate it, he click on a button 'Valider'.

 

My expectation would be to get a form with two columns. The first one with every question and the second with the answer (even empty if not replied).

I want also precise that I didn't create neither form nor data table, I don't know if it could be useful for what I want to do?

 

Regards,

 

Highlighted
Dual Super User III
Dual Super User III

Re: Collect Radio button value from a gallery

@Djuls 

 

Can you please try to modify your expression as:
 
Clear(Collection_Test), ForAll(Gallery_Questions.AllItems,Collect(Collection_Test,{Question:Label_Question.Text, Answer: Radio_Answer.Selected.Value}))
This will create a collection iterating over all the items in your gallery control.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Highlighted
Super User
Super User

Re: Collect Radio button value from a gallery

@Djuls 

Sorry I misunderstood your original question - you had mentioned you wanted to NOT use the Gallery.AllItems data for some reason and it appeared you just wanted to get a specific question and answer from your gallery.

The screen shots helped, but looks like you figured out your solution already.

Glad you figured it out.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: Collect Radio button value from a gallery

Don't worry, I was probably not clear enough. But maybee you can reply to my second part 😉 which is how can I check that for every line of the column 'Answer' from collection 'Collection_Test' is not empty?

Highlighted
Super User
Super User

Re: Collect Radio button value from a gallery

@Djuls 

For that, based on the collection you have now, you can sum the values:

   If(Sum(Collection_Test, If(IsBlank(Answer), 1, 0)) > 0, "unanswered questions", "all answered")

This will sum the values of the Answer column - 1 if it is blank and 0 if it is not blank.  If the sum is greater than 0, then there are blank/unanswered questions.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,192)