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 / Clearcollect with Lookup
Power Apps
Answered

Clearcollect with Lookup

(0) ShareShare
ReportReport
Posted on by 538

Experts,

 

I have following table ,

 

Table name  oki  and columns are follows

mm ,planta, plantb , plantc, plantd

 

AVTS_0-1654708949710.png

 

 

TableB name  emailedc and columns are follows

email , plant

 

 

sadsd2333.PNG

 

Existing formula 

 

ClearCollect(mmasterv1,oki)

 

With this all data is replicating to table mmasterv1

 

Requirement is i need to restrict the materials by plant . it should look at the log in user plant and plant in oki table. Tried with below formula looks not working. 

 

ClearCollect(mmasterv1,LookUp(emailedc,email=User().Email,plant = oki.planta )


);

 

Please share your expertise 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,369 Most Valuable Professional on at

    Hi @AVTS ,

    Try Filter instead of LookUp - you are also referencing a Table in the second part

    ClearCollect(
     mmasterv1,
     Filter(
     emailedc,
     email = User().Email && 
     plant in oki.planta
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • AVTS Profile Picture
    538 on at

    Hi @WarrenBelz  thank you tried this but plant is not coming if you add && . What could be the issue ?

  • WarrenBelz Profile Picture
    156,369 Most Valuable Professional on at

    Hi @AVTS ,

    Actually looking at it again

    ClearCollect(
     mmasterv1,
     Filter(
     emailedc,
     email = User().Email && 
     (
     plant in oki.planta ||
     plant in oki.plantb ||
     plant in oki.plantc ||
     plant in oki.plantd
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • AVTS Profile Picture
    538 on at

    Hi @WarrenBelz  thanks for your response, 

     

    With this formula collection  mmasterv1 is showing filtered data from tableb which is emailedc instead of showing filtered data from tableA which is oki.

     

    Expected results , if user abc@yahoo.com logged in then collection(mmasterv1) should only the data of U051 from table1 oki.

    mm
    10121900
    10153701
  • WarrenBelz Profile Picture
    156,369 Most Valuable Professional on at

    @AVTS ,

    That is what I needed originally (the result you actually wanted) - try

    With(
     {
     wPlant:
     LookUp(
     emailedc,
     email = User().Email
     ).Plant
     },
     Filter(
     oki,
     planta = wPlant ||
     plantb = wPlant ||
     plantc = wPlant ||
     plantd = wPlant
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • AVTS Profile Picture
    538 on at

    Hi @WarrenBelz  clearcollect we should correct ? 

     

    ClearCollect(
    mmasterv1,

    With(
    {
    wPlant:
    LookUp(
    emailedc,
    email = User().Email
    ).plant
    },
    Filter(
    oki,
    planta = wPlant ||
    plantb = wPlant ||
    plantc = wPlant ||
    plantd = wPlant
    ))
    );

  • Verified answer
    WarrenBelz Profile Picture
    156,369 Most Valuable Professional on at

    @AVTS ,

    This structure would probably be better

    With(
     {
     wPlant:
     LookUp(
     emailedc,
     email = User().Email
     ).plant
     },
     ClearCollect(
     mmasterv1,
     Filter(
     oki,
     planta = wPlant ||
     plantb = wPlant ||
     plantc = wPlant ||
     plantd = wPlant
     )
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard