web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Lookup a collection ag...
Power Apps
Unanswered

Lookup a collection against a record value

(0) ShareShare
ReportReport
Posted on by 82
Hi,
 
I've been trying to solve the following problem. I have an app that displays 1 question at a time from my database of questions. All questions are mapped to a QuestionID and DifficultyLevel.

I've noticed that sometimes the same question appears. So I have started a collection "ShownQuestions" that records the QuestionID of the questions being displayed.

How can I modify my current code that displays the next question by first seeing if it is being asked previously and if so, display another question.
"
//Set the next question
Set(
    CurrentQuestion, //CurrentQuestion is whats being displayed
    First(
        Shuffle(
            Filter(
                QBANK, //QBANK is my question bank.
                Difficulty = NextDifficulty  //NextDifficulty is how i determine the next difficulty based on a logic.
            )
        )
    )
);
"
 
 
Categories:
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at
    Hi,
     
    Store the questions that are shown in the ShownQuestions collection.
    Then, you can check if a question is already in the collection
     
     
    // Set the next question
    Set(
        CurrentQuestion, // CurrentQuestion is what's being displayed
        First(
            Shuffle(
                Filter(
                    QBANK, // QBANK is your question bank
                    Difficulty = NextDifficulty && // NextDifficulty is how you determine the next difficulty based on a logic
                    !IsBlank(LookUp(ShownQuestions, QuestionID = QuestionID)) // Check if the question has already been shown
                )
            )
        )
    );
     
  • Suggested answer
    timl Profile Picture
    36,319 Super User 2025 Season 2 on at
    Hi User_Naami 
     
    Here's some alternative syntax that should also work.
    Set(
        CurrentQuestion, 
        First(
            Shuffle(
                Filter(
                    QBANK, // QBANK is your question bank
                    Difficulty = NextDifficulty,
                    Not(QuestionID in ShownQuestions.QuestionID) 
                )
            )
        )
    );
     
  • User_Naami Profile Picture
    82 on at
    Hi @timl and @Spong Ye both the solutions does not work.

    It displays the first question but then the second question just returns blank.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard