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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filter the Dropdown da...
Power Apps
Unanswered

Filter the Dropdown data based on Current User Login

(0) ShareShare
ReportReport
Posted on by 105

Hello Experts!
    My data source is from Share Point List which have
 * Manager Name
*  Project Name
*  Tasks
*  Description
*  Assigned To 

When 'Employee' opens the Power apps
The Tasks Dropdown filtered only the current user's assigned task. 
Not to show all the assigned tasks in the source data.

I have 2 drop downs which is Project drop down and Task Drop down,
When an employee selects a particular project that project related assigned task only shown in Task dropdown

Thanks in advance,
Pooja-B

Categories:
  • JD382 Profile Picture
    114 on at

    Hi Pooja-B,

     

    You can filter the sharepoint list by user by putting this in the Items property of your Task dropdown:

    Filter(SharePointListName, 'Assigned To'=User().FullName)

     

    Be sure that the format of the names in your SP list is First Last to match the output of User().FullName. If you are unsure, just create a text box and set the Text property to User().FullName to see how your name is displayed.

     

    The same holds true for your other question. Put this in the Items property of your Task dropdown.

     

    Filter(SharePointListName, 'Project Name'=ProjectDropDown.Selected.Result)

     

    To combine the two, you can nest one within the other:

     

    Filter(

        Filter(

            SharePointListName,

            'Project Name'=ProjectDropDown.Selected.Result

        ),

        'Assigned To'=User().FullName

    ).Tasks

     

    Or, if you want to show all Tasks if project is not selected you can do this (i.e. all tasks for a user for all projects):

    Filter(

        Filter(

            SharePointListName,

                If(

                   CountRows(ProjectDropDown.SelectedItems)>0,

                   'Project Name'=ProjectDropDown.Selected.Result,

                   true

               )

        ),

        'Assigned To'=User().FullName

    ).Tasks

     

    I'm new to PowerApps myself, so there might be a more elegant way to do this. 

     

    Hope this helps!

  • B-Pooja Profile Picture
    105 on at

    Hi @JD382 ,
     Thank you so much for your quick response,
    I tried that above code in Text box it is displaying my name but,

    BPooja_0-1677766278212.png

    I got an Error, 
    Here .Tasks means a SharPoint List name or what?

    For 'Assigned to'  it is an Person field datatype in Share Point List, assign 2 or more person in List 
    But, it shows here, "Name isn't valid" , "Assigned To Isn't recognized"  error

    Can you help me to resolve this issue

    Thanks,
    Pooja-B

  • JD382 Profile Picture
    114 on at

    The Filter function creates an internal table of data. Since the filter is creating the table from your sharepoint list, the column headings in the filter table will have the same name as the column headings in your sharepoint list. The ".Tasks" selects the column name "Tasks". You can change this to whatever your Task column is named. This all assumes that the Task column only contains one value. Maybe you could share an example of what your data looks like?

     

    Since your name field is a record in your sharepoint list, you may find it better to use the Users email, which would change User().FullName to User().Email and 'Assigned To' to 'Assigned To'.Email.

  • B-Pooja Profile Picture
    105 on at

    Hi @JD382 ,
    I tried your code, I got the below error.

    BPooja_0-1677850517924.png

    How to Solve this issue.

    My Exact scenario is, 
    I have 3 List in SharePoint
    1) Project List -  It has list of Project names data only.
    2) Manager List - Manager assign a task to an employee. Employee is multi select option.
                                 Here I take the Look up column as Project Name from Project share point list.
    3) Master List - Employee task Progress data were stored here.
                              I take 2 Look up column,
                              Project from Project list
                              Task from Manager list

    I created a Power app edit form which have the source data as Master List
    I removed the data card from Project and Assigned Task.
    Instead of that I added new drop down in Project and Assigned Task Data card respectively.


    The result of my Power App is
    Project Drop down                                       Task Drop down
    1) It Lists all the Project data,                          1) Here, it lists only what are the tasks in the Project assigned by                                                                             the log in user  in Manager share point list that  tasks only list
     2) Drop Down Data were  stored in                   in this drop down
         Master Share Point List                                   
                                                                           2) Drop Down Data were  stored in Master Share Point List


    Thanks,
    Pooja-B.
                                                                         


  • JD382 Profile Picture
    114 on at

    Just to confirm I'm understanding this correctly, MasterList is the source of EditForm, which employees will use to enter information regarding the status of their tasks. MasterList is tied to two additional lists; ProjectList is essentially a source of available projects and ManagerList is the means by which employees are assigned tasks.

     

    The one part for this I'm unsure of is figuring out how to get the user information to filter your list. In my powerapps, User().FullName returns "Firstname Lastname", but the lookup column in my sharepoint list column for Employees has a property called "DisplayName" that returns "Lastname, Firstname [organization name]". So I clearly can't say User().FullName = Employee.DisplayName. But I could use .Email for both such that User().Email = Employee.Email. You'll have to figure out how to get this filtering to work for your powerapp. For the purposes of my example, I'll just assume that you'll use "Email" in the code below.

     

    If I was designing this, I would have EditForm and a Gallery on the screen with the two dropdowns for Project and Task to serve as filters. Let's assume this is the case and you have EditForm, GalleryChoices, DropdownProject, and DropdownTask. Of course, you'll need a submit button as well. I'll also assume that you want to allow the user to select project and/or task, not in any particular order and not necessarily both.

     

    Note: The other option would be to make the user select one first and then the other by setting the DisplayMode of the second selector (task, in this case) to If(IsBlank(DropdownProject.Selected), DisplayMode.Disabled, DisplayMode.Edit).

     

    You can place the following code in the object - property given before the code block. This should prohibit users from seeing/selecting tasks/projects that aren't within their assignments. Hope this helps!

    DropdownTask - Items:
    Distinct(
      Filter(
        MasterList,
        'Assigned To'.Email=User().Email,
        If(
          IsBlank(CountRows(DropdownProject.SelectedItems)),
          true,
          'Project Name'.Value=DropdownProject.Selected.Result
        )
      ),
      Task.Value
    )

     

    DropdownProject - Items:
    Distinct(
      Filter(
        MasterList,
        'Assigned To'.Email=User().Email,
        If(
          IsBlank(CountRows(DropdownTask.SelectedItems)),
          true,
          Task.Value=DropdownTask.Selected.Result
        )
      ),
      'Project Name'.Value
    )

     

    GalleryChoices - Items:
    Filter(
      MasterList,
      'Assigned To'.Email=User().Email,
      If(
        IsBlank(CountRows(DropdownTask.SelectedItems)),
        true,
        Task.Value=DropdownTask.Selected.Result
      ),
      If(
        IsBlank(CountRows(DropdownProject.SelectedItems)),
        true,
        'Project Name'.Value=DropdownProject.Selected.Result
      )
    )

     

    EditForm - Item:
    GalleryChoices.Selected

  • B-Pooja Profile Picture
    105 on at

    Thank you so much!

  • JD382 Profile Picture
    114 on at

    One thing I forgot. In your edit form, be sure to set the display mode to view for the project and task data cards. Otherwise users will be able to change those.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard