cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NewNW
Level: Powered On

Filter Drop Down Choices Based on login user group

Hi All,

I have couple of Sharepoint groups and users are been added to the groups. Based on the logged-in user's group I want to add values in to a dropdown called Site Drop down.

eg- Group A, Broup B, Group C

 

Site Drop down items if the loged in user in Group  A -> Item A1, Item A2, Item A3

                                    if the loged in user in Group A and B -> Item A1, Item A2, Item A3, Item B1, Item B2

                                    if the loged in user in Group C -> Item C1, Item C2, Item C3

Can someone please tell me, how can I do this ?

 

Thnaks. 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: Filter Drop Down Choices Based on login user group

Hello @NewNW,

 

For what you want to do, you have to use the connexion "Office 365 Groups".

You can set:

Application.OnStart = 

Clear(DropdownContent);
If("GroupA" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "A1", "A2", "A3"));
If("GroupB" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "B1", "B2"));
If("GroupC" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "C1", "C2", "C3"))

/!\ Warning : 'Office365Groups' isn't the same syntax depending of your region (for example in France it's 'GroupesOffice365') /!\

 

DropDown.Items =

DropdownContent

Keep me informed 🙂

 

Best regards,

 

Louis

 

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Re: Filter Drop Down Choices Based on login user group

Hello @NewNW,

 

For what you want to do, you have to use the connexion "Office 365 Groups".

You can set:

Application.OnStart = 

Clear(DropdownContent);
If("GroupA" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "A1", "A2", "A3"));
If("GroupB" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "B1", "B2"));
If("GroupC" in Office365Groups.ListOwnedGroups().value.displayName, Collect(DropdownContent, "C1", "C2", "C3"))

/!\ Warning : 'Office365Groups' isn't the same syntax depending of your region (for example in France it's 'GroupesOffice365') /!\

 

DropDown.Items =

DropdownContent

Keep me informed 🙂

 

Best regards,

 

Louis

 

View solution in original post

NewNW
Level: Powered On

Re: Filter Drop Down Choices Based on login user group

Thanks LouisC.

I cannot use O365 group , it has to be SP group. seems to be currently PowerApps dosent allow that.

 

Thanks.

Anonymous
Not applicable

Re: Filter Drop Down Choices Based on login user group

For me a Sharepoint Group is also a O365Group no ?

Highlighted
CindyZ
Level: Powered On

Re: Filter Drop Down Choices Based on login user group

Thanks for your input.  I've tried a number of iterations of this and, after a couple of hours, still no success.  Any thoughts?  

 

Clear(' Requests’.'Comment Type');

If(

    "RequestsEveryone Members" in Office365Groups.ListOwnedGroupsV2().value.displayName,

    Collect(

        ‘Requests’.'Comment Type',

        "Note to Supplier"

    )

);

If(

    "RequestsAdmins Members" in Office365Groups.ListOwnedGroupsV2().value.displayName,

    Collect(

        ' Requests’.'Comment Type',

        "Note to Supplier",

        "Internal Note"

    )

)

 

I just created the groups -- does it take time for them to take effect?  I've also tried it without "Members" on the end of the name.  Finally -- does display name refer to matching the name of the individual logged in to the name of the person in the Office 365 group?  

 

This is not creating a collection at all. Everytime I look, there  is nothing there. 

 

Thanks so much!

Anonymous
Not applicable

Re: Filter Drop Down Choices Based on login user group

Hello @CindyZ,

 

Do you have errors in your code ?

And what is your 'Requests'.'CommentType' ? Does it already exist ? Try to create the collection with a single name 'CommentType'.

 

I made a sample of code for you, try with it :

Clear(CommentType);
If(
    "RequestsEveryone Members" in Office365Groups.ListOwnedGroupsV2().value.displayName,
    Collect(
        CommentType,
        "Note to Supplier"
    )
);
If(
    "RequestsAdmins Members" in Office365Groups.ListOwnedGroupsV2().value.displayName,
    Collect(
        CommentType,
        "Note to Supplier",
        "Internal Note"
    )
)

I put again my warning 

/!\ Warning : 'Office365Groups' isn't the same syntax depending of your region (for example in France it's 'GroupesOffice365') /!\

With it, it gives :

Clear(CommentType);
If(
    "RequestsEveryone Members" in GroupesOffice365.ListOwnedGroupsV2().value.displayName,
    Collect(
        CommentType,
        "Note to Supplier"
    )
);
If(
    "RequestsAdmins Members" in GroupesOffice365.ListOwnedGroupsV2().value.displayName,
    Collect(
        CommentType,
        "Note to Supplier",
        "Internal Note"
    )
)

Best regards,

 

Louis

 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,303)