cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bam
Frequent Visitor

Checking/Validating is sharepoint entry is created

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,

1 ACCEPTED SOLUTION

Accepted Solutions
BCLS776
Super User
Super User

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

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
BCLS776
Super User
Super User

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

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Bam
Frequent Visitor

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

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Bam
Frequent Visitor

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!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,840)