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

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

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
    Lookup a collection against a record value
    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
    35,805 Super User 2025 Season 2 on at
    Lookup a collection against a record value
    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
    Lookup a collection against a record value
    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 671 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 424 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 243

Last 30 days Overall leaderboard