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

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

Helpful resources

Announcements
Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

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.

<
Users online (3,982)