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
Highlighted
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 III
Super User III

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.
Highlighted
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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,884)