cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dyee4613
Level 8

Gallery Duplicating Questions

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?  

1 ACCEPTED SOLUTION

Accepted Solutions
dyee4613
Level 8

Re: Gallery Duplicating Questions

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.  

View solution in original post

3 REPLIES 3
Highlighted
Community Support Team
Community Support Team

Re: Gallery Duplicating Questions

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-clearc...

 

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
dyee4613
Level 8

Re: Gallery Duplicating Questions

 

@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

dyee4613
Level 8

Re: Gallery Duplicating Questions

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.  

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,178)