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 Automate / Return 10 Questions to...
Power Automate
Unanswered

Return 10 Questions to SP List that Don't Match Questions Already on SP List

(2) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2
I am working on building a quiz creator that randomizes the new questions to an existing quiz.

The user clicks a Power Apps button that triggers a flow that retrieves data from the 'Active Test Questions' list
and the 'General Questions and Answers' list where the Quiz Name 'Course Names' match.

The 'Active Test Questions' list has 10 questions on it. The 'General Questions and Answers' list has 30 questions
on it, including the 10 questions on the 'Active Test Questions' list.

The flow seems to be working, adding 10 questions to the 'Active Test Questions' list, except it is returning a few
questions (in the example 13, 17, and 21) that are already on the 'Active Test Questions' list.

As the 'General Questions and Answers' list has 30 questions, seems to me every time the flow runs it should be able
to return 10 NEW questions, with none of the new questions matching the questions already on the 'Active Test Questions'
list.

What am I missing?

Active Test Questions list (Post Flow Run) -


Flow -



 
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
     
    You would need to a column, that marks a question already used, then use a Filter where that field is set to No/False.
     
    But it just won't magically do it.
     
    If these suggestions help resolve your issue, Please consider Marking the answer as such and also maybe a like.
    Thank you!
    Sincerely, Michael Gernaey
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    @Michael E. Gernaey

    If I may; then why does it not repeat ALL questions already on the 'Active Test Questions'
    list?

    It is only repeating two, three or four existing questions.

    1. There are 30 total questions on the 'General' list. This is the repository for all questions.
    2. The 'Active' list only has 10 questions at any given time.
    3. The flow is already comparing the question numbers from the 'Active' list to those on the
    'General' list.
    4. The flow is (supposedly) filtering out question numbers from the 'General' list that are
    match question numbers on the 'Active' list, to avoid duplication.

    I'm not understanding why some questions already on the 'Active' list are making it
    through the process and being added back to the 'Active' list in the Create Action
    and the rest of the existing question numbers are not.

    The rest of the flow is working fine. Seems I should be able to fine-tune a filter or condition
    somewhere to solve this problem, rather than adding a column to a list to resolve it, yes?
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    I remembered I answered similar question.....
    The comparison is not correct ( you will get pass if you test).
    what you need is initialize an array for your active question title. 
    Use a apply to each to append the array variable.
    you should build an array like ["Q14","Q15"....] 
    then use the array value to compare in the Filter array:
     
    for example :
     
    not(
        contains(
           variables('My10TitleArray'), 
            item()?['Title'] // 30 quetions list title.
        )
    )
     
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    @stampcoin

    Does the image below show a form of filter that should achieve the same goal?

    The first 'Select' select is pulling in all Question Numbers from the 'Active Question List'.

    The 'Select - General Questions' is pulling in all the questions from the 'General Question List'.

    The 'Compose - Reorder General Questions' shuffle the returned general questions.

    The 'Compose - Select 10 General Questions' isolates ten general questions.

    The 'Filter Array' is comparing the output of the 'Select - 10 General Questions' to the
    'Select - Active Question Numbers', and those that don't match are processed in the
    'Apply to each' and the 'Create item'.

  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    I doubt that.
    My first comment I thought you wanted to figure out the 10 rand questions not in Active 10 questions.
     
    Let me try to understand you if I am correct.
    If you want it to give 10 questions.
    1. 10 Active questions is a subset of 30 questions.
    2.  find out the 10 of 30.
    3. from the left 20, randomly pick 10.
     
    But the current flow indicates 10 compares 10
    Or I misunderstood you ?
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    @stampcoin

    @stampcoin
     
    1. 10 Active questions is a subset of 30 questions.
        Correct.
        The questions on the 'Active Questions List' list are a sub-set of questions from the
        'General Questions List'.

    2. Find out the 10 of 30.
        Correct.
        The flow should identify the ten questions on the 'Active Question List', compare those to
        the thirty on the 'General Question List' and return ten questions from the 'General Questions List'
        that DO NOT match the ten questions in the current iteration of the 'Active Questions List'; meaning
        the flow should add ten completely new and different questions to the 'Active Question List'.

    3. From the left 20, randomly pick 10.
        Correct.
        From the remaining questions on the 'General Questions List' return 10 new (non-repeating)
        questions. 

             *The numbers 10 (Active list) and 30 (General list) are just for testing.
              The actual 'Active list' could have 25 or 50 questions.

              The 'General list' will have hundreds of questions. The flow should return
              an equal number of new (non-repeat questions) from the 'General list' to
              the 'Active Questions List'. None of the new questions should match those
              in the current iteration of the 'Active Questions List'.


    4. The flow should then delete the existing ten questions on the 'Active Questions List'. This is already
        being accomplished without issue.


    The only thing not working correctly is the flow keeps returning two to five questions as part of the new set of 10 questions that are already in the 10 current questions the 'Active Questions List'.

    Intent of the flow:
    On every run the flow should retrieve 10 questions from 'General' list that DO NOT match the 10 questions already on the 'Active' list, load those 10 new questions to the 'Active' list and delete the
    previous ten questions from the 'Active list'. 

    Flow Collapsed -


    Flow Expanded -
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    I think your flow doesn't match what you described.
     
    I show you the minimal flow from me.
    1.  Get Items from List A( your active question List).
    2.  Initialize Variable to save the unique column, Here is my list Title, I called it MyAcitiveQ.
    3.  Select Title column from A, name it PO.
    4.  Apply each item, append current PO to the array.
    5.  Get Items from List B( your General question List).
    6.  Select some columns from B, with Title as well ( Let's say B.Title is the key like A.Title ).
    7.  Filter Selection B , which PO column doesn't contain MyAcitiveQ's value.
    8.  Now the output only contains Totally new Items.
    Now the output only contains new items. You can build the shuffler if needed, delete Items from List A, insert List A.
    Hope this make sense.
     
     
    Whole pic.
  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at
    @stampcoin

    I thought I had it correct, but I'm getting the same result.

    This time the new questions include three of the existing
    Active Questions (Q01, Q20, Q24).

    What am I missing?

    Original Active List
     
    New Questions - Post Flow, which includes three
    existing questions, but should not.

     
    Flow -
     
     
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
     
    1.  Select - Active Questions, Title column is enough.
     
    2. Filter array - Separate Out Existing Active Questions.
     
    In this step, should use contains function, try to change it to 
    not(
        contains(
           variables('ActiveQuestions'),
            item()?['GeneralQuestionNumber']
        )
    )
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Have you made any progress ?

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard