cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JonasH Helper II
Helper II

Collect/Patch saves one record more than one time

Hi,

I want to store data in a collection and upload it to a SQL-DB later on.

The problem is, that the collect and patch statement saves the data multiple times in the collection.

To save the data to the collection I used the following statement:

Collect(pics,{
Uploadedby:User().FullName,
FileName:input_takenpicturename.Text,
ImageContent:TakenPic,
UploadedTime:Text(Now(),DateTimeFormat.UTC),
PositionGUID:EditPosition.GUID});

To take a Picture I used the following statement:

UpdateContext({TakenPic:Camera1_2.Stream}) 

Here is a quick example:2019-10-21 14_20_56-ONCR - Saved (Unpublished) - PowerApps.pngThis is how I want to save the Picture to the collection. Its the picture above the textbox with textbox input as the title.

If I hit the save button the result looks like this:2019-10-21 14_21_11-ONCR - Saved (Unpublished) - PowerApps.png

Sometimes the pictures are saved once and other times more than three times!

 

Thanks for your help.

1 ACCEPTED SOLUTION

Accepted Solutions
JonasH Helper II
Helper II

Re: Collect/Patch saves one record more than one time

I solved it on my own.

To sync the collection with my SQL-DB I used multiple timers. All with the same function.

In one of the last updates they added the feature, that timers can run in background.

The problem was, that the same images were uploaded by multiple timers simultaneous.

View solution in original post

1 REPLY 1
JonasH Helper II
Helper II

Re: Collect/Patch saves one record more than one time

I solved it on my own.

To sync the collection with my SQL-DB I used multiple timers. All with the same function.

In one of the last updates they added the feature, that timers can run in background.

The problem was, that the same images were uploaded by multiple timers simultaneous.

View solution in original post

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

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