Expression Pulling the Wrong Data

For my clock-in app, I have the following expression:

INDEX(SELECT(Users[Employee Name], (USEREMAIL() = [_THISROW].[Employee Email])),1)

The idea is it automatically populates the Employee Name field, and the user just hits Save.

The problem is it’s not pulling the user’s name, it’s pulling mine. I suspect this is because [_THISROW] doesn’t exist yet, the record of the clock-in hasn’t been created yet. Referencing the table directly throws an error, comparing the wrong types of data.

Any ideas?

Try

ANY(SELECT(Users[Employee Name], ([Employee Email]=USEREMAIL())))

1 Like

Instead of using brute force all over your app to pull the user information, I would implement the current user system inside your app.

Forgive me I’m on mobile, it’s difficult to search through the community and find the specific post to give you a link. But if you search for current user, you’ll eventually find a post I made a long time ago describing how to do this.

4 Likes

Usersettings(Name)

I have implemented this way. But it requires each App user to mention the name once in the App Settings.

1 Like

Here you go @MultiTech and @Qiro

Current User (Slice) | How to conform your app a… - Google Cloud Community

I am currently sitting at my work desk , so could find it easily in Tips an Tricks Section.

4 Likes

Great, thanks for the heads up.

I’ll take a look at this tonight and see whether I can make it work.

1 Like

OK - I have implemented your approach and got it working, except I’m having a few issues.

This function isn’t to allow the users exclusive access to the app, it is simply to allow them to clock in and out. It is an administration app, that has other functions. The problem with this setup is now every time I try to edit an existing record, it just repopulates everything with my own data, corrupting the record, instead of allowing me to edit existing data. I would do this if someone forgets to clock out, for example.

How can I prevent it automatically updating the record once it’s created?

You’ve provided too few details.

How is this whole process working?