The scenario is before someone uses a tool they either complete a checklist for that tool or if a checklist has been submitted previously for that tool, they get to review the defects noted from the previous submission. i.e. the problem is Displaying Defect Answers only from an earlier submission.
When a checklist is submitted it patches to a Sharepoint list.
When the next person comes along, and selects the tool, I create a collection of the latest submission "LatestSubmissions" for that tool. The collection is a single line table with the questions, answers and any comments for defects where a defect is A = "N". There can be multiple questions in the checklist, field_4 = Q01, field_5 is A01, field_6 is C01, field_7 = Q02, field_8 is A02, field_9 is C02. etc.
I am looking to be able to show to create another Collection "NResponses" of all the Questions and Comments where the Answer is N, so I can display them on a Gallery with Items "NResponses". However I can not work out how to create that NResponses collection - I can create it for the first N answer, or the last N answer, but not more than 1.
For example, this only captures one answer.
ClearCollect(
NResponses,
ForAll(
LatestSubmissions,
If(
field_5 = "N",
Collect(NResponses, {Question: field_4, Comment: field_6})
);
If(
field_8 = "N",
Collect(NResponses, {Question: field_7, Comment: field_9})
)
)
)
Any suggestions appreciated.