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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Duplicating Qu...
Power Apps
Answered

Gallery Duplicating Questions

(0) ShareShare
ReportReport
Posted on by 301

I have an app that uses 4 galleries to store my questions. 

 

Here is how I set it up:

The "OnVisible" for each page has my collection.  This contains all my questions. 

 

Collect(Bedroom,
{Q_ID: 47, Q_Type:"Bedrooms",Q_Desc:"Walls and Ceiling", Ans:""},
{Q_ID: 48, Q_Type:"Bedrooms",Q_Desc:"Floor Covering", Ans:""},

etc..etc...

 

The gallery's item quality is set to this collection.  The on select patches the value to the answer.

 

Patch(Bedroom, ThisItem, {Ans:Radio1_5.SelectedText.Value})

 

When the user is done, the submit button creates a collection with all the data from all the tabs filled out (bedroom, bathroom, kitchen, etc).  

 

Problem: When you switch tabs, then return to the original tab the questions double.  For example, if I went from the bedroom to the bathroom, to the bedroom, I will now have 20 questions (the same 10 twice).  I was able to eliminate this with the home button by adding a clear(Bedroom) everytime they press home.  However, I need the data from all sections so I can't do a clear from moving from the bedroom to the bathroom.  Any ideas?  

Categories:
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @dyee4613 ,

    Do you want to solve the problem about repeating creation of collections?

    I recommend you try the function of ClearCollect.

    For example, set the bedroom's Screen's Onvisible:

    ClearCollect(Bedroom,
    {Q_ID: 47, Q_Type:"Bedrooms",Q_Desc:"Walls and Ceiling", Ans:""},
    {Q_ID: 48, Q_Type:"Bedrooms",Q_Desc:"Floor Covering", Ans:""},

    When you come back to bedroom Screen, the collection will be rebuilt and the data is as same as original collection.

    Here's a doc about ClearCollect for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearcollect

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

  • dyee4613 Profile Picture
    301 on at

     

    @v-yutliu-msft 

     

    Thanks for the solution!  Unfortunately, this won't work for my app.  I thought about doing this when I added the clear when users click home.  The user needs to see what they entered in each tab and clearcollect won't show that.  Can you explain what's causing the gallery to duplicate every time I leave the page?

     

    Edit: I tried clearcollect + Load data, this doesn't work either because it just adds it to the bottom of my questions

  • Verified answer
    dyee4613 Profile Picture
    301 on at

    I think I figured it out.  I'll delete the other tabs and put all the data on one tab.  I'll switch the navigation bar to a filter and I'll just filter to whatever section they want.  

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard