cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Writing to Collection is taking too much time

Hi All,

I am building an app which contains a gallery with 60 rows. Each row has a "Yes/No" dropdown , a date picker , a multiline text and camera control. When I am trying to capture them in a collection , it takes a lot of time to save it. I am using the below formula:

ForAll(FormElementsGallery.AllItems,
Collect(
collectionNewFormEntries,
{ID:IDLbl.Text,
Complete:DropDownComplete.Selected.Value,
SubsectionDates:CompletedDate.SelectedDate,
Project_Name:ProjectListDropdown_1.Selected.SourceShortCode,
Notes:NotesInput.Text,
UpdatedDate:Today(),
FormStartDate:FormStartDateText_1.Text,
UpdatedBy:profile.MailNickname,
CamCaptures:LookUp(ImagesCam1,ID= IDLbl.Text,CamImages),
Status:"Saved",
Approver:OperationDCOMText_1.Text}

));

SaveData(collectionNewFormEntries,"collectionAllPrevFormEntries");

 

It takes almost 15-20 seconds, is there anyway I can optimize it to less than 5 sec ,as no user will be waiting that much.
Also, on submit it writes everything to a sharepoint location which takes even longer. Any help on this please.

 

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Writing to Collection is taking too much time

Hi @v-shsi16 ,

You are only collecting one record as such (and writing to the device), but the line that jumps out for me is this one

CamCaptures:
LookUp(
   ImagesCam1,
      ID= IDLbl.Text,
      CamImages
)

How many pictures are likely to be in the collection (I assume it is one) ImagesCam1.CamImages and how big are they?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

3 REPLIES 3
Highlighted
Community Champion
Community Champion

Re: Writing to Collection is taking too much time

Hi @v-shsi16 ,

You are only collecting one record as such (and writing to the device), but the line that jumps out for me is this one

CamCaptures:
LookUp(
   ImagesCam1,
      ID= IDLbl.Text,
      CamImages
)

How many pictures are likely to be in the collection (I assume it is one) ImagesCam1.CamImages and how big are they?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Writing to Collection is taking too much time

Hi @v-shsi16 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Highlighted
Microsoft
Microsoft

Re: Writing to Collection is taking too much time

Hi Warren,

You are right there only one picture per gallery item, the reason it was taking too much time was the duplicates, when I removed those it worked fine.

Thanks

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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