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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,263)