web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Updating a collection ...
Power Apps
Unanswered

Updating a collection based on a multiple rows from a SQL table

(0) ShareShare
ReportReport
Posted on by 164

Dear Brainstrust,

 

I am building a timesheet application to capture timesheet hours and would like to ensure that users can only enter times which are free ie have no times already used.

 

I have a SQL table with timesheet transactions

 

dbo.timesheet.transactions

Id

Start_Time

Finish_Time

Employee_Id

Date

Activity_Type

 

I also have a time table with allowable times

 

dbo.timesheet.times

Id

Time

Free

 

Where time is in 15min increments

 

To restrict the user from entering times which already exist I've created a collection based on the dbo.timesheet.table which I want to use to check whether a new record's time is free and update when a new timesheet record is created. The check and update needs to work for a range of times between Start_Time and Finish_Time for each record. Collection name ColTimes

 

I'm stuck on how to update the collection with the times used, for example:

 

2 timesheet records dbo.timesheet.transactions

 

Record 1

Id 1

Start_Time 8:00

Finish_Time 10:00

Employee_Id 4

Date 11-23-2020

Activity_Type Work

 

Record 2

Id 2

Start_Time 10:00

Finish_Time 12:30

Employee_Id 4

Date 11-23-2020

Activity_Type Work

 

The resulting Collection

 

ColTimes

Id

Time

Free

 

Would look like this:

 

IdTimeFree
112:00:00 AMYes
212:15:00 AMYes
312:30:00 AMYes
412:45:00 AMYes
51:00:00 AMYes
61:15:00 AMYes
71:30:00 AMYes
81:45:00 AMYes
92:00:00 AMYes
102:15:00 AMYes
112:30:00 AMYes
122:45:00 AMYes
133:00:00 AMYes
143:15:00 AMYes
153:30:00 AMYes
163:45:00 AMYes
174:00:00 AMYes
184:15:00 AMYes
194:30:00 AMYes
204:45:00 AMYes
215:00:00 AMYes
225:15:00 AMYes
235:30:00 AMYes
245:45:00 AMYes
256:00:00 AMYes
266:15:00 AMYes
276:30:00 AMYes
286:45:00 AMYes
297:00:00 AMYes
307:15:00 AMYes
317:30:00 AMYes
327:45:00 AMYes
338:00:00 AMNo
348:15:00 AMNo
358:30:00 AMNo
368:45:00 AMNo
379:00:00 AMNo
389:15:00 AMNo
399:30:00 AMNo
409:45:00 AMNo
4110:00:00 AMNo
4210:15:00 AMNo
4310:30:00 AMNo
4410:45:00 AMNo
4511:00:00 AMNo
4611:15:00 AMNo
4711:30:00 AMNo
4811:45:00 AMNo
4912:00:00 PMNo
5012:15:00 PMNo
5112:30:00 PMYes
5212:45:00 PMYes
531:00:00 PMYes
541:15:00 PMYes
551:30:00 PMYes
561:45:00 PMYes
572:00:00 PMYes
582:15:00 PMYes
592:30:00 PMYes
602:45:00 PMYes
613:00:00 PMYes
623:15:00 PMYes
633:30:00 PMYes
643:45:00 PMYes
654:00:00 PMYes
664:15:00 PMYes
674:30:00 PMYes
684:45:00 PMYes
695:00:00 PMYes
705:15:00 PMYes
715:30:00 PMYes
725:45:00 PMYes
736:00:00 PMYes
746:15:00 PMYes
756:30:00 PMYes
766:45:00 PMYes
777:00:00 PMYes
787:15:00 PMYes
797:30:00 PMYes
807:45:00 PMYes
818:00:00 PMYes
828:15:00 PMYes
838:30:00 PMYes
848:45:00 PMYes
859:00:00 PMYes
869:15:00 PMYes
879:30:00 PMYes
889:45:00 PMYes
8910:00:00 PMYes
9010:15:00 PMYes
9110:30:00 PMYes
9210:45:00 PMYes
9311:00:00 PMYes
9411:15:00 PMYes
9511:30:00 PMYes
9611:45:00 PMYes

 

 

Any help on solving the correct syntax would be greatly appreciated!!

 

 

Karl

 

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard