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: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
JonasH
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
JonasH
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,327)