cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sonaldag
New Member

Write multiple times to a sharepoint list and return the last entered value when click of a button

This is related to PowerApps time tracker which was created by @RandyHayes 

In it I have created 2 separate buttons called "break" & "back". So ultimate goal is for users to be able to log unlimited amount of breaks and show the last time they took a break and when they came back ( eg. user takes a break at 4.00 comes back at 4.10 then when user click the break button again the user must be able to see the current time in break button, not the last break time which is 4.00)

 

I only managed to write 1 set of "break" & "back" to sharepoint list from below code with time showing on button 

Onselect

 

Coalesce(Text(ThisItem.value),ThisItem.display) = Self.Text && ThisItem.enabled 

 


Text

 

Coalesce(Text(DateTimeValue(ThisItem.value),ShortTime), ThisItem.display)

 



If I only show the ThisItem.display on the button text value then i can write multiple times to sharepoint list 

Onselect

 

ThisItem.display = Self.Text && ThisItem.enabled

 


Text

 

ThisItem.display

 



Initially only "break" should be enabled. when click "break" then "back" button should be enabled. not sure how this will work when we do multiple breaks

 

Items

 

With({data:DataCard1.Update},
Table(
{display:"Break", value:data.Break, enabled: IsBlank(data.Back) && IsBlank(data.Break) || !IsBlank(data.Back) },
{display:"Back", value:data.Back, enabled: !IsBlank(data.Break) }
)
)

 


Also below code only filter today values. lets see if someone who checkin yesterday night and checkout today morning then this wont work. is there anyway we could filter by last 24hrs?

 

With({lclRecs:Filter('Attendance Tracker', Title=glbUser && StartsWith(ActivityDateTime, Text(Today() , "[$-en-US]yyyymmdd")) ) },

 




Any help is much appreciated 

I'm just a newbie to powerapps 
 

0 REPLIES 0

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,529)