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

Validate choice in Gallery

Hello all,

I have a employee early leaving app that allows employees to scan their ID and leave. Only authorised employees are able to leave and if they are not-authorised an error message is display (this is done by countrow of gallery used). 

So the app has a simple barcode scanner and a gallery view which shows only authorised employees details(retrieved from Sharepoint list 1) and gives them option to signout, which again records back to another Sharepoint list 2.
Now for certain employees, I have to allow them only on certain days of week only ( say they can leave only on Monday and Thursday). In the sharepoint list 1, the day allowed is a choice column allowing multiple selections.

How would I validate if the employee is allowed on the app access day tobe allowed or not.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @HadiAbdul,

Do you want to check if the day the current user leaves is the allowed access day?

Could you please share a bit more about the scenario?

 

Firstly, you should determine if today is the allowed access day for the current user based on the SharePoint list1.

Set the OnSelect property of the submit button as below:

If(
    !(Weekday(
        Today(),
        StartOfWeek.Monday
    ) in Concat(
        LookUp(
            Product,
            Employee.Email = User().Email
        ).AccessDay,
        Value,
        ","
    )),
    Notify(
        "No access day found!",
        Error
    )
)
Best Regards,
Qi

View solution in original post

3 REPLIES 3
CNT
Super User
Super User

@HadiAbdul You have to filter your gallery further for records that have Today() in the days of week that they are allowed to leave.

v-qiaqi-msft
Community Support
Community Support

Hi @HadiAbdul,

Do you want to check if the day the current user leaves is the allowed access day?

Could you please share a bit more about the scenario?

 

Firstly, you should determine if today is the allowed access day for the current user based on the SharePoint list1.

Set the OnSelect property of the submit button as below:

If(
    !(Weekday(
        Today(),
        StartOfWeek.Monday
    ) in Concat(
        LookUp(
            Product,
            Employee.Email = User().Email
        ).AccessDay,
        Value,
        ","
    )),
    Notify(
        "No access day found!",
        Error
    )
)
Best Regards,
Qi

View solution in original post

Thanks. this helped and I was able to clear by this logic code

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,136)