Power Apps Exchange

Please login or click SIGN UP FOR FREE to create your PowerAppsUG account to join this user group.
 View Only
  • 1.  Adding a Search function to a Filter function

    Gold Contributor
    Posted Nov 10, 2021 10:18 AM

    Hi,

    I know this is probably an easy one but I'm scratching my head how to resolve it?

    Currently have this function

    If(dropStartersLeavers.SelectedText.Value = "Starters",
    Sort(Filter(Volunteers, 'Start Date' >= dateFrom_2.SelectedDate && 'Start Date' <= dateTo_2.SelectedDate), 'Start Date', Descending),
    Sort(Filter(Volunteers, 'Leaving Date' >= dateFrom_2.SelectedDate && 'Leaving Date' <= dateTo_2.SelectedDate), 'Leaving Date', Descending)
    )

    It users the options, in a dropdown box, that  contains "Leavers" and "Starters" and two Date Pickers (To and From)

    I know need to add the functionality to search for Names.  This is in case either the Leaver / Starter dates are not known.

    The columns names in the SP list is "First Name" and "Surname"

    Thank you in advance



    ------------------------------
    Chris Clark
    Application Support Developer / Analyst
    ------------------------------



  • 2.  RE: Adding a Search function to a Filter function

    Gold Contributor
    Posted Nov 11, 2021 04:48 AM
    Hi Chris,

    I think you can just add a filter for Firstname surname in both cases, let's assume you have a textbox called txtNameSearch, it besomes something like
    If(dropStartersLeavers.SelectedText.Value = "Starters",
    Sort(Filter(Volunteers, (txtNameSearch.Text in "First Name" II  txtNameSearch.Text in "Surname" ) &&( 'Start Date' >= dateFrom_2.SelectedDate && 'Start Date' <= dateTo_2.SelectedDate)), 'Start Date', Descending),
    Sort(Filter(Volunteers, (txtNameSearch.Text in "First Name" II  txtNameSearch.Text in "Surname" ) &&('Leaving Date' >= dateFrom_2.SelectedDate && 'Leaving Date' <= dateTo_2.SelectedDate)), 'Leaving Date', Descending)
    )

    Best regards,

    ------------------------------
    Alaa Bitar
    Modern Workplace Architect
    Serial Sa
    ------------------------------



  • 3.  RE: Adding a Search function to a Filter function

    Gold Contributor
    Posted Nov 11, 2021 11:13 AM

    Hi Alaa,

    Thank you for your response.

    Not sure if I detailed correctly what I require.

    I need the the name to be a single search functionality if the dates of when the user Started or Left are not known.  I think this formula actually requires these to be populated?  



    ------------------------------
    Chris Clark
    Application Support Developer / Analyst
    ------------------------------



  • 4.  RE: Adding a Search function to a Filter function

    Gold Contributor
    Posted Nov 11, 2021 12:11 PM
    Hi Chris,

    When you say if the dates of when the user Started or Left are not known do you mean that the fields are empty?
    Best regards,

    ------------------------------
    Alaa Bitar
    Modern Workplace Architect
    Avanade
    ------------------------------



  • 5.  RE: Adding a Search function to a Filter function

    Gold Contributor
    Posted Nov 11, 2021 12:28 PM

    Hi Alaa,

    Yes as the dates are unknown so these two fields will need to be left empty



    ------------------------------
    Chris Clark
    Application Support Developer / Analyst
    ------------------------------