cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Duplicate records in collections after Patch, Refresh, Clearcollect - SQL

Hi Guys,

 

I have an issue. I have a collection of items, downloaded from an SQL view. I'm patching one of these items in SQL table directly and then I do what I understand to be a full refresh cycle:

1. Refresh SQL data source

2. Clearcollect the collection used as a data source for my gallery.

 

The result is that I do see the updated record, but it appears twice... I even tried clearing the collection, multiple refreshes and clearcollects, delayed refreshes using timer - nothing seems to work.

 

I checked the SQL - no duplicates, I clearcollected data filtered by this item ID to a new collection, only one item is shown.

 

Only when I quit the app and re-open it, the duplicate value disappears.

 

What could be the issue? I would appreciate any suggestions. I'm stuck here...

Thanks and regards.

1 ACCEPTED SOLUTION

Accepted Solutions

Hey @RandyHayes ,

Thanks for the response. It actually helped. I was able to replicate the issue in an empty screen, so it got me thinking on my connections and I have found the culprit and a workaround.

 

At first I was working with SQL views (most convenient way to join tables for me). The views always create this issue for me, but if I join what I want using AddColumns to a collection, the problem disappears.

 

I would love to have it working using views, but I don't really have time to dwell on this now. If someone has found similar issues (and a solution) when working with SQL views in PowerApps, please chip in! 🙂

 

Best regards,

SG

View solution in original post

3 REPLIES 3
Super User III
Super User III

@SnowGroomer 

In general, from your description, this all sound like it should be working.  So, there must be some factor that is at play here and you need to hunt it down.

 

I would perform a simple test on a different screen without any other factors (no variables at play, no extra actions, etc.) and see if you can duplicate the problem on a totally "fresh" setup.

 

Check that out and if no joy, post back again and provide some of your formulas you're using.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Hey @RandyHayes ,

Thanks for the response. It actually helped. I was able to replicate the issue in an empty screen, so it got me thinking on my connections and I have found the culprit and a workaround.

 

At first I was working with SQL views (most convenient way to join tables for me). The views always create this issue for me, but if I join what I want using AddColumns to a collection, the problem disappears.

 

I would love to have it working using views, but I don't really have time to dwell on this now. If someone has found similar issues (and a solution) when working with SQL views in PowerApps, please chip in! 🙂

 

Best regards,

SG

View solution in original post

I am able to confirm I am experiencing the same issue with SQL view. Will try the AddColumns now. Thank you for sharing. 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,638)