cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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:This is how I want to save the Picture to the collection. Its the picture above the textbox with textbox input as the title.This 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
Highlighted
Helper II
Helper II

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

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

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

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

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