cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Post Patron
Post Patron

After Updating a list closing a app and open

Hi,

I want to store login and logout time in a list.

i opened an app and store a details in a SharePoint list.

My list is following,

NameDateLoginLogout
Dani17/0205/2117/0205/21 10.30 AM 

 

I stored a Details in a list using following formula,

Patch(List, Defaults(List),{Name:Label1.Text,Date:Today(),Login :Now()})

But once i closed the app and need to update a Logout time in a list its could not updating..

 

How to update a Logout time in a list after stored a login time and once closed an app and after that when reopen app i need to store a Logout time?

 

Is it possible?

 

Thanks,

Dhinesh

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Eelman ,

Its updating a list while once app is open.. 

But when we close an app after when we open an app a variable is empty. Its not updating when we click a Logout button.

 

So i did a following steps:

 

app onstart stored a list into a collection.
ClearCollect(Check,Filter(List,IsToday(Date)));

Logout Button onclick i checked a Previous set variable is empty or not, Empty means stored a collection to other variable.
If(IsBlank(Login), Set(Out,Check));


After that i patch for Logout through this last set variable,

Patch(List,{ID:First(Out).ID},{Logout:Now()})

 

Now its updating a Logout time when ever we close and reopen an app we can update a logout time.

 

 

Thanks,

Dhinesh

 

View solution in original post

4 REPLIES 4
Eelman
Super User
Super User

@Dhinesh28R 

Login

Set( vLogin, 
    Patch(List, Defaults(List),{Name:Label1.Text,Date:Today(),Login :Now()})
)

 

Logout

Patch(
    List, 
    LookUp(List, ID = vLogin.ID),
    {Logout: Now()}
)

   

The issue will be that not all users will click an Icon / Button / Label to exit so the logout may not always be captured. I capture Login details for my apps but don't worry about Logout, just much of a hassle.

 

Hi @Eelman ,

Its updating a list while once app is open.. 

But when we close an app after when we open an app a variable is empty. Its not updating when we click a Logout button.

 

So i did a following steps:

 

app onstart stored a list into a collection.
ClearCollect(Check,Filter(List,IsToday(Date)));

Logout Button onclick i checked a Previous set variable is empty or not, Empty means stored a collection to other variable.
If(IsBlank(Login), Set(Out,Check));


After that i patch for Logout through this last set variable,

Patch(List,{ID:First(Out).ID},{Logout:Now()})

 

Now its updating a Logout time when ever we close and reopen an app we can update a logout time.

 

 

Thanks,

Dhinesh

 

View solution in original post

@Dhinesh28R 

Ok, so do you still need any help? I'm unsure what you are describing here but it seems like you have made your own solution? If so, mark it as the solution so others can find it and this thread can be closed.

 

If it's not solved, please explain the issue a little further.

Hi @Eelman,

No need man, its completed man.. Now working man.

 

Thanks,

Dhinesh

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 (11,007)