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 / check if an email exis...
Power Apps
Answered

check if an email exists in a collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

This is complicated since I only need the emails of a respective ID

I will give you the example

I make a filter that returns several emails (I need it)

 

Filter (
"Training of participants",
IdTraining = Value (lblIdTraining.Text)
).Mail

 


this returns me


exaplemail1@mail.com
exaplemail2@mail.com
exaplemail3@mail.com

so I have a screen in powerapps where I manually register people in a collection

 

Collect (
List,
{
QR Name: DataManual.name,
EmailQR: DataManual.mail,
PositionQR: DataManual.position,
DepartmentQR: DataManual.department,
AreaQR: DataManual.area
}
)

 

the name, email, position, department and area are stored in the collection

Now I want to know if there is an email from those I brought in the previous filter in collection


i'm dealing with

 

Filter (
"Training of participants",
IdTraining = Value (lblIdTraining.Text)
).Mail in List.EmailQR

 

it gives me the error

cannot use table values ​​in this context

I guess it's because they are a set of elements.

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

    Try this:

    IsBlank(Filter("Training of participants",
    IdTraining = Value(lblIdTraining.Text),
    Mail in List.EmailQR
    ))
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous thanks for answering

     

    This does not work if I put it in an If condition

     

    If (
     IsBlank (
     Filter (
     'Training participants',
     IdTraining= Value (lblIdTraining.Text),
     Mail in List.EmailQR
     )
     ),
     Patch (
     'Training participants',
     First (
     Filter (
     'Training participants',
     IdTraining = Value (lblIdTraining.Text)
     )
     ),
     {Status: "Didn't Present"}
     )
    )

     

     

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

    If needs boolean. Patch doesn't return a Boolean

     

    Instead, 

     

    1. Set a boolean variable
    2. in If statement, say Set(YourVar,true)
    3. Make Timer Control, set visible to false, set auto start to false, set repeat to false, and set Start to YourVar
    4. Set duration of timer to 1 (1 millisecond) to be quick as possible - or you can set it a bit higher if you want like 100 or so.
    5. In Timer Onstart, move your Patch there
    6. In Timer Onend, set the variable to false again Set(YourVar,false) so timer can be reused.
    7. This should help in these kinds of cases.
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

    Or, try a simpler alternative to Timer (maybe it works):

     

    Wrap the whole Patch in a Boolean returning function such as IsBlank, etc. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Anonymous 

    Okay, let me take a step back. Let's build a new collection based off of these two data sets. We'll do that by using AddColumns() to loop through one to build on to the other.

     

    ClearCollect(PresentedResultSet,
    AddColumns(
     List,
     "Presented",
     !IsBlank(LookUp(Filter('Training of participants',IdTraining = Value(lblIdTraining.Text)),EmailQR=Mail,EmailQR))
    ))

     

    Then, we can test against this new collection called PresentedResultSet.

     

    Filter(PresentedResultSet,Presented=true)

     

    Meaning your last Patch() example should look like this,

     

    ForAll(PresentedResultSet,If(Presented=false,
     Patch (
     'Training participants',
     First (
     Filter (
     'Training participants',
     IdTraining = Value (lblIdTraining.Text)
     )
     ),
     {Status: "Didn't Present"}
     )))

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hello @Anonymous ,

    I'm sorry to bother you, the formula only updates me to the first filter element and that person attended


    example

    Person who did not appear:
    ExampleEmail2@email.com


    Person who appeared:
    ExampleEmail1@email.com

     

    The filter is updated to: ExampleEmail1@email.com

     

    I think the problem is in the First (Filter ())
     
    😞

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Sorry, yeah the Patch() is throwing me off. Do you just need a collection of users that didn't present? That would just be my solution above, only after the ClearCollect() you can just use this:

    Filter(PresentedResultSet,Presented=false)

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard