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 / Drop Down List filtere...
Power Apps
Unanswered

Drop Down List filtered from another list in other source and conditions

(0) ShareShare
ReportReport
Posted on by 248

Hi again,

 

Now I'm trying to filter one Drop Down list, but the difficult is that the target field is in other SP list.

 

I have a Machinery Screen:

 

Screenshot_1.png

 

And the TimeSheet Screen:

 

Screenshot_2.png

 

The field names and "imput text" are in Machinery Screen:

Fecha Alta = DataCardValue23 (On hire date)

Fecha Baja = DataCardValue24 (Off hire date)

Title = DataCardValue26 (Machinery)

 

And in the TimeSheet Screen:

Fecha = DataCardValue3 (Date)

Equipo = DataCardValue4 (Machinery)

 

The Dropdown list of the Mchinery in TimeSheet Screen is a lookup field from the Machinery Screen.

 

So, I don't want show the Machinery that is not "active", and the conditions will be depend of the date in TimeSheet screen and the dates in Machinery Screen.

 

I was thinking in two options:

 

Option 1 - Easiest (I think):

 

I have an hide field on Machinery Screen. That field is the Status, that calc depend of the dates (basicaly if the Off hire date is complete or not), the values are "Activo" or "Inactivo". For this option I tried diferent things, but doesn't work, like:

 

Items property over "Equipo" field on TimeSheet Screen:

Filter(Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo); Value in Filter ('ALQUILERES EQUIPOS'; estado = "Activo").Equipo)

 

"Alquiler Equipos - Horarios y Trabajos" (Source on TimeSheet)

"Alquiler Equipos" (Source on Machinery Screen)

 

 

Option 2 (I will preffer this one, but I don't know if is possible or is so hard to do it):

 

I don't want show the machinery: if "date" that you write is before to "on hire date" or later to "of hire date", and in case that the "off hire date" is blank don't show the machinery "on hire date" is later that the date on timesheet.

 

Thank you.

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @ Manarjomar:

    Could you tell me :

    Does this lookup field allow multiple selections?(Equipo)

    What is your filter rule? Could you describe it in detail?( What function is implemented in which field of which data source meets what conditions?)

    Option1:

    Firstly, let me explain why the code doesn’t work.

    The result returned by "Filter (...). E" is a table with a nested structure, and the “Value” you need to retrieve is in it’s sub-table. This caused the code to not work.

    Secondly, I suggest you try this code:

    Filter(Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo);Value in ForAll(Filter('ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'; estado = "Activo");Equipo).Value)

    Option2:

    I am not sure what you mean by “I don't want show the machinery:……hire date" is later that the date on timesheet”.

    But, if you would like to share more details with me, I will be happy to discuss the solution with you.

     

    Best Regards,

    Bof

  • Manarjomar Profile Picture
    248 on at

    Hi@v-bofeng-msft 

     

    I tried make a translatios for expain my scenario, sorry if is not the best translation. hehehe

     

    For the option 1:

     

    I have two table (or list)

     

    "ALQUILER EQUIPOS" that have the field "Equipo" and the target field "Estado" (values = "Activo" / "Inactivo"). This list manage a list of "Machinery".

     

    "ALQUILER EQUIPOS - HORARIOS Y TRABAJOS" have the lookup field "Equipo" (With multiselection: the name of the machinery in field "Equipo" and the "Estado" of the list "ALQUILER EQUIPOS") and is the Dropdown field that I need to filter. The objetive of this list manage the works and timesheet for each worker and machinery.

     

    Thank for the suggest, but the code doesn't work:

     

    Screenshot_3.png

     

     

    For the option 2:

     

    Trying to explain...

     

    For the Option 1, was make a filter using the field "Estado", but with this option I would like make it if the diferent dates it fulfill the conditions:

     

    "ALQUILER EQUIPOS" have two field dates "Fecha Alta" (like "on hire date" in English), "Fecha Baja" ("Off hire date" in English").

     

    "ALQUILER EQUIPOS - HORARIOS Y TRABAJOS" have the field "Fecha" (date to manage the TimeSheet).

     

    The condition to show the Machinery "Equipo" in the dropdown will be with two conditions, and could be something like:

     

    If(And(IsBlank('ALQUILER EQUIPOS'.'Fecha Baja');'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'.Fecha >= 'ALQUILER EQUIPOS'.'Fecha Alta);And('ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'.Fecha >='ALQUILER EQUIPOS'.'Fecha Alta';'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'.Fecha <='ALQUILER EQUIPOS'.'Fecha Baja'))

     

    I know that could be difficult, but with this option the form can permit me create a record if the machinery is "off hire" but the date is between the "onhire date" (Fecha Alta) and "offhire date" (Fecha Baja).

     

    I hope that you can understand me.

     

    Thank you.

     

     

     

     

     

  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    HI @Manarjomar :

    Option1:

    Maybe you can try this code:

    Filter(Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo);Value in Ungroup(Filter('ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'; estado = "Activo");Equipo).Value)

    Option2:

    Do you want to influence the options of Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo) by filtering the value of 'ALQUILER EQUIPOS' and 'ALQUILER EQUIPOS'?

    Although I still don't understand it very well-maybe because of the language. In my opinion, the lookup field of Equipo allows multiple selections, which makes it difficult for us to judge whether the 'Fecha Baja' in the associated 'ALQUILER EQUIPOS' table is empty.

     

    Best Regards,

    Bof

  • Manarjomar Profile Picture
    248 on at

    Ok @v-bofeng-msft , forget the Option 2.

     

    Howeaver, the code for the Option 1, I don't understand where is the error, because with your new code, doesn't work neither...

     

    Screenshot_4.png

     

     

    I tried with this one alse:

     

    Filter(Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo);Value in ForAll(Filter('ALQUILERES EQUIPOS'; Estado = "Activo");Equipo).Value)

     

    Only because I thought the "Estado" field is on the other table ("ALQUILERES EQUIPOS") was not possible find in "ALQUILER EQUIPOS - HORARIOS Y TRABAJOS", but doesn't work also.

     

    Screenshot_5.png

     

     

    But when I try.

     

    Screenshot_6.png

     

     

    Regards.

     

     

     

  • Manarjomar Profile Picture
    248 on at

    Finally

     

    For me was impossible fix the problem like I wanted, but inestead I found other "simple" way.


    I created a new field on the main list "ALQUILER EQUIPOS", a calculate field make as concatenate string with the field name of "Equipo" and the field name "Estado", to have this one in the app:

     

     

    Screenshot_1.png

     

    Later I can filter the drop down with the string "(Activo)":

     

    Filter(Choices([@'ALQUILER EQUIPOS - HORARIOS Y TRABAJOS'].Equipo); "(Activo)" in Value)

     

    So the Machineries ("Equipo") that is offhire ("Inactivo"), is not on the list.

     

    This is not the solution that I wanted it but works.

     

    Thank you.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard