I have a local value of list type that that has column with different boolean values. 

I also have an action that went pressed is supposed to show results of a test, total correct (True) and wrong (False) answers from the list.


How can I iterate over that column and count the different True and False values, so I can display the score to the user? Is listFilter an option here?

Hi Filipe,


You can either use a ForEach to iterate your list and count the correct and wrong answers or a ListFilter action. See the examples below.


Using ForEach:


Using ListFilter:


Hope it helps,


Regards,

Miguel Chaparra

Miguel Chaparra wrote:

Hi Filipe,


You can either use a ForEach to iterate your list and count the correct and wrong answers or a ListFilter action. See the examples below.


Using ForEach:


Using ListFilter:


Hope it helps,


Regards,

Miguel Chaparra

 Thank you for your response! For some reason the debugger won't stop at the breakpoint for-each loop, so I want to learn to use ListFilter.

I managed to set the answerList = True and answerList = False get all the correct and wrong values.

Thank you for your help! :D

Solution

Felipe Sepulveda wrote:

Miguel Chaparra wrote:

Hi Filipe,


You can either use a ForEach to iterate your list and count the correct and wrong answers or a ListFilter action. See the examples below.


Using ForEach:


Using ListFilter:


Hope it helps,


Regards,

Miguel Chaparra

 Thank you for your response! For some reason the debugger won't stop at the breakpoint for-each loop, so I want to learn to use ListFilter.

I managed to set the answerList = True and answerList = False get all the correct and wrong values.

Thank you for your help! :D

Hi Filipe,


Happy that you got it working! One tip, when working with booleans you don't need to compare your variable to true or false, instead just change answerList = True to simply answerList and answerList = False to not answerList.


Regards,

Miguel Chaparra

Solution