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?
Solved! Go to Solution.
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.
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:
Best regards,
Community Support Team _ Phoebe Liu
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
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.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
200 | |
69 | |
50 | |
46 | |
20 |
User | Count |
---|---|
258 | |
121 | |
84 | |
79 | |
69 |