cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sumeetrajan
Helper I
Helper I

update a sharelist twice with help of powerapp

I am trying to develop an attendance tracker in the power-app connected to SharePoint list (user, log in & log out time).

since the user would be updating the app twice( once during login  & another during log out), 2 different list are created. cannot find a way to combine in one list. can someone help?

 

 

login function - Patch('Online Attendance',Defaults('Online Attendance'),{'Log in':Text(Now(),DateTimeFormat.ShortDateTime)} 

logout function - Patch('Online Attendance',Defaults('Online Attendance'),{'Log out':Text(Now(),DateTimeFormat.ShortDateTime)}

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @sumeetrajan ,

 

Please try this:

login function - Set(Thevar,Patch('Online Attendance',Defaults('Online Attendance'),{'Log in':Text(Now(),DateTimeFormat.ShortDateTime)} ))

logout function - Patch('Online Attendance',Thevar,{'Log out':Text(Now(),DateTimeFormat.ShortDateTime)})

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

3 REPLIES 3
v-xiaochen-msft
Community Support
Community Support

Hi @sumeetrajan ,

 

Please try this:

login function - Set(Thevar,Patch('Online Attendance',Defaults('Online Attendance'),{'Log in':Text(Now(),DateTimeFormat.ShortDateTime)} ))

logout function - Patch('Online Attendance',Thevar,{'Log out':Text(Now(),DateTimeFormat.ShortDateTime)})

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

sumeetrajan
Helper I
Helper I

works perfect 🙂 thank you so much

Hi @v-xiaochen-msft ,

There is an issue, suppose I "log in" via app & then I close the app, later when I reopen the app & try to use "log out" button the SharePoint list doesn't update. 

but if I use log in & log out at the same time (without closing the app), the list is updated perfectly.

i guess the app deletes the variable we created, once we close the app. any other way of doing this?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (26,567)