Hello Everyone,
I've had a bit of a look at previous questions and they have given me some good ideas on things to try, which has led me to where I am at.
I have created an app for Covid check-ins. It captures the users Email, name, timestamp, and the answers to each question that is asked. What I'm trying to do is create a label that tells the user if they have already checked in today or not.
Problem/What I'm trying to achieve: Check two columns from the sharepoint list, first one is the user's email, the column is named "User". Second column is a timestamp of when they checked in, this column is named "Timestamp". I want the Powerapp to check the sharepoint list to see if the user is on the list with a timestamp of today or not.
Here is how far I have gotten, am I using the right function by using the If statement here or is there something much more easier/useful? I'm just getting a invalid syntax error.
Here is my syntax:
If(Value('COVID HSE List Prototype'.User = Office365Users.MyProfile().Mail) And Value('COVID HSE List Prototype'.Timestamp = IsToday( Now() )), "You have already checked in today", "You have not checked in today")
Any thoughts?
Cheers and sorry for any typos,
Solved! Go to Solution.
I think this will work better for you:
If(!IsBlank(
LookUp('COVID HSE List Prototype', User = Office365Users.MyProfile().Mail And IsToday( Timestamp )
)),
"You have already checked in today",
"You have not checked in today"
)
However, make sure the User column in your data source is populated with email addresses and not person-type records.
Hope that helps,
Bryan
I think this will work better for you:
If(!IsBlank(
LookUp('COVID HSE List Prototype', User = Office365Users.MyProfile().Mail And IsToday( Timestamp )
)),
"You have already checked in today",
"You have not checked in today"
)
However, make sure the User column in your data source is populated with email addresses and not person-type records.
Hope that helps,
Bryan
Thanks mate, I was doing some research and came across the IsBlank and LookUp Functions. Should I not be declaring which column for the IsToday to do the Lookup?
I assumed the column in your table that we want to check as match today's date was 'Timestamp', so IsToday(Timestamp) should return true if that field contains today's date. If you have a different column name, definitely use that one.
Bryan
Oh I see now, it's actually more simple than I thought. After looking at Microsofts documentation, it looks like to need a "Now" or "Today" within the brackets of the IsToday. So it seems you can just have IsToday and aim it at the desired column. I original did the IsToday( Now() because the Timestamp Column in the table captures both date and time.
Thanks again for the help, you're a legend!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
202 | |
47 | |
43 | |
40 | |
36 |
User | Count |
---|---|
289 | |
81 | |
81 | |
79 | |
71 |