cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper V
Helper V

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
Highlighted
Helper V
Helper V

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
Community Support

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.
Highlighted
Helper V
Helper V

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

Highlighted
Helper V
Helper V

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,054)