cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Collection of office 365 Users?

Hi all,

 

I have built an app which is in production and working away nicley. The app has to have several screens that only certain managers can see. The app OnStart shows the following -
If(Mail = "user@example.com",Navigate(ManagerScreen,ScreenTransition.None), , Mail="user2@example.com", Navigate(ManagerScreen, ScreenTransition.None).....we have 20+ emails in here and i have this on most of the home icons of the shared screens too.

I am worried about there being too many emails listed and over time i expect more users to be added to this.

I was wondering if there was a way i can add these users to a collection, then i could use the collection as an If function? I cant seem to work this out so would appreciate any help or suggestions if there is a better way?

 

Thanks

Donna

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Collection of office 365 Users?

Hi @Anonymous ,

Do you want to check if the current sign user is an manager, if true, then navigate him/her to the Manager screen?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the OnStart property of the App control to following:

ClearCollect(
            ManagerEmailCollection,
            "user@example.com",
           "user2@example.com",
           "user3@example.com",
           ...
           "user20example.com",
           ...
);
If(
    User().Email in ManagerEmailCollection,       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

Or

ClearCollect(
            ManagerEmailCollection,
            "user@example.com",
           "user2@example.com",
           "user3@example.com",
           ...
           "user20example.com",
           ...
);
If(
    Mail in ManagerEmailCollection,
    Navigate(ManagerScreen, ScreenTransition.None)
)

Please consider take a try with above solution, then check if the issue is solved.

 

In addituion, you could also consider add a data source (e.g. a SP List) to store the managers' email. You could consider type the manager email within the Title column (one record for one Manger email). Then add this SP list in your app as data source, and set the OnStart property of the App control to following:

If(
    Lower(User().Email) in Lower('YourSPList'.Title),       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

Or

If(
    Lower(Mail) in Lower('YourSPList'.Title),       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

then re-load your app, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Highlighted
Skilled Sharer
Skilled Sharer

Re: Collection of office 365 Users?

Hi,

 

You can acheive this by many ways, one of the best way is:-

 

Create a list with only one defualt column- title, having all email ids of users.

 

//tempRequest is the new list 

 

Create a text input varialbe and on that - Find(Lower(User().Email) ,Lower(tempRequest.Title),1)

 

Now, - if(Value(<your text input varialble>0),Navigate....,otherNavigation)

 

 

Highlighted
Anonymous
Not applicable

Re: Collection of office 365 Users?

Thanks @panand99 but it doesnt seem to work for me.

 

I created a SharePoint list, added to data source, created text input but i have the attached errors.

Highlighted
Super User
Super User

Re: Collection of office 365 Users?

@Anonymous 

Now that you've created a list with the emails listed in it, change your OnStart formula to the following:

 

If(
!IsBlank(
Lookup(L3, Lower(Title)=Lower(Mail)).Title
),
Navigate(ManagerScreen, ScreenTransition.None)
)

This assumes that you have a varible called Mail.  

Also, since you are doing this in the OnStart, make sure that your App settings are not set to allow non-blocking OnStart rules as you'll want this to occur not in parallel with other rules.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Community Support
Community Support

Re: Collection of office 365 Users?

Hi @Anonymous ,

Do you want to check if the current sign user is an manager, if true, then navigate him/her to the Manager screen?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:

Set the OnStart property of the App control to following:

ClearCollect(
            ManagerEmailCollection,
            "user@example.com",
           "user2@example.com",
           "user3@example.com",
           ...
           "user20example.com",
           ...
);
If(
    User().Email in ManagerEmailCollection,       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

Or

ClearCollect(
            ManagerEmailCollection,
            "user@example.com",
           "user2@example.com",
           "user3@example.com",
           ...
           "user20example.com",
           ...
);
If(
    Mail in ManagerEmailCollection,
    Navigate(ManagerScreen, ScreenTransition.None)
)

Please consider take a try with above solution, then check if the issue is solved.

 

In addituion, you could also consider add a data source (e.g. a SP List) to store the managers' email. You could consider type the manager email within the Title column (one record for one Manger email). Then add this SP list in your app as data source, and set the OnStart property of the App control to following:

If(
    Lower(User().Email) in Lower('YourSPList'.Title),       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

Or

If(
    Lower(Mail) in Lower('YourSPList'.Title),       /* or type User().Email in ManagerEmailCollection.Value */
    Navigate(ManagerScreen, ScreenTransition.None)
)

then re-load your app, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Collection of office 365 Users?

Hi all thank you so much for all your responses.

 

@v-xida-msft- i have adopted your solution and it is perfect! This has cleaned up things so much better in my app. Thank you so much! 🙂

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,402)