web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter Drop Down Choic...
Power Apps
Unanswered

Filter Drop Down Choices Based on login user group

(0) ShareShare
ReportReport
Posted on by 204

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. 

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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

     

  • NewNW Profile Picture
    204 on at

    Thanks LouisC.

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

     

    Thanks.

  • Community Power Platform Member Profile Picture
    on at

    For me a Sharepoint Group is also a O365Group no ?

  • CindyZ Profile Picture
    on at

    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!

  • Community Power Platform Member Profile Picture
    on at

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard