Custom timesheet app

Hi guys,

I am creating a timesheet app and I have a couple of queries.

  1. What expression would I use to set [start time] to be the same as [finish time] from the previous row?  LOOKUP([_THISROW].[_RowNumber]-1, “Timesheet”, “_RowNumber”, “Start Time”)
  2. My timesheet table has a [name] column and I want it to be auto-populated based on the [full name] value from the "Staff" table with the same email as the logged in user? Ive tried this and variations of it, but its not working:   IF(USEREMAIL()=Staff[email][_THISROW],Staff[Full Name][_THISROW],"")
  3. Im trying to set editing rights to the user only, but get this error, even though the email field is of email type,not enum?
  4. jonbowles84_0-1644582599847.png

     

I

0 2 110
2 REPLIES 2


@jonbowles84 wrote:
  1. What expression would I use to set [start time] to be the same as [finish time] from the previous row?  LOOKUP([_THISROW].[_RowNumber]-1, “Timesheet”, “_RowNumber”, “Start Time”)

I don't use LOOKUP() much, but it looks ok to me.  Does it not work for you?  I have to wonder what "previous row" means?  Is this just the last row entered by anyone - period? 

 


@jonbowles84 wrote:
My timesheet table has a [name] column and I want it to be auto-populated based on the [full name] value from the "Staff" table with the same email as the logged in user? Ive tried this and variations of it, but its not working:   IF(USEREMAIL()=Staff[email][_THISROW],Staff[Full Name][_THISROW],"")

You can't use dereferences in the manner you have shown.  You can assign [Full Name] by using an expression like this:

ANY(SELECT(Staff[Full Name], USEREMAIL() = [Email]))

SELECT returns a list (a list of one in this case) and you need to extract the value from the list - the reason for the ANY() function.

 


@jonbowles84 wrote:
Im trying to set editing rights to the user only, but get this error, even though the email field is of email type,not enum?

I think you are trying to set conditions so that the user can only Edit his/her own rows but still see the other rows?  The expression you are in will impact the entire table.  To control editing per row, you need to apply your expression to the Edit action itself. The expression you have can be directly copied into the system Edit action Behavior section.  

By the way, your expression isn't working for two reasons.  First, you must be returning one of enum values shown in the message at the top.  Second, this is table level permissions so you cannot inspect individual rows to decide the permissions - which is what the usage of [email] implies.

I hope these help!

Thats brilliant, thankyou! I just need to figure out the start/end time now...
The value of [start time] should be the same as [finish time] of the previous entry of the same user if there has already been an entry today if not I guess a time in the morning "7:00am" maybe...

Top Labels in this Space