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 / Set Variable and filte...
Power Apps
Unanswered

Set Variable and filter based off a lookup column

(1) ShareShare
ReportReport
Posted on by 8

Hello, I am trying to do two things: Set a variable to a SP list to filter the cert titles if the logged in user email is the same as email in the person column and then update the context of one of my textboxes based on the lookup column values in the SP list. I keep getting an error that says that I have an invalid number of arguments. How can I fix this? Thank you!

 

These are my two functions:

Set(myCertCollection,
 If(User().Email = LookUp('Staff Certifications', Person.Email), Filter('Staff Certifications', Certification.Value && Status.Value = "Certification Active")),
 
 "Title", Ascending
 
);

 

//Foundation-----------------------------
UpdateContext({uDS1: Concatenate(CountIf(LookUp(myCertCollection, Certification.Value,
'Practice Area'.Value = "Digital Services" && 'Practitioner Level'.Value = "1 - Foundation"), 
" Certifications", Char(13), Char(13))});
Categories:
I have the same question (0)
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @powerHelp This doesn't look correct to me at all, and I'm looking at just the myCertCollection part. First of all the Set formula you gave has syntax that looks like it belongs in SortByColumns function.

     

    Next you have  User().Email = LookUp('Staff Certifications', Person.Email) when maybe it should be User().Email =

    LookUp('Staff Certifications', Person.Email).Email

    Then you have Filter('Staff Certifications', Certification.Value && Status.Value = "Certification Active") - here you have Certification.Value && - are you sure Certification.Value resolves to a true or false (i.e. boolean) value by itself? If not, you should change Certification.Value && to something else.

     

    I didn't even look at the  Foundation one but taking a quick look at it, you have 

    LookUp
    (
    myCertCollection
    ,Certification.Value
    ,'Practice Area'.Value = "Digital Services" && 'Practitioner Level'.Value = "1 - Foundation"
    )

    However the third argument of Lookup should be a reduction formula to return a specific result based on the found record, I don't think it should be additional filters, those belong in the second argument only. So you should have something like 

    LookUp
    (
    myCertCollection
    ,Certification.Value && 'Practice Area'.Value = "Digital Services" && 'Practitioner Level'.Value = "1 - Foundation"
    )

     I am however assuming Certification.Value resolves to a boolean - if it doesn't, the above formula will result in errors too.

     

    There may be more issues too. What are the errors you see and in which formulas do you see them in?

     

  • powerHelp Profile Picture
    8 on at

    It says that they both have invalid arguments still

     

     

  • powerHelp Profile Picture
    8 on at

    And for the .Email part after the parenthesis, it says email isn't recognized

  • powerHelp Profile Picture
    8 on at

    Last thing is that it says that this functions has incompatible comparison types:

    If(User().Email = LookUp('Staff Certifications', Person.Email).Email,
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @powerHelp 

     

    Set(myCertCollection,
     If(User().Email = LookUp('Staff Certifications', Person.Email), Filter('Staff Certifications', Certification.Value && Status.Value = "Certification Active")),
     
     "Title", Ascending
     
    );

     

    Even if you change it to 

     

     

    Set(myCertCollection,
     If(User().Email = LookUp('Staff Certifications', Person.Email).CorrectColumn, Filter('Staff Certifications', Certification.Value && Status.Value = "Certification Active")),
     
     "Title", Ascending
     
    );​

     

    Even if CorrectColumn is the correct one (maybe yours is not called Email) this is still invalid syntax because "Title" and "Ascending" belong in the SortByColumns function,not Set, So you may need to try like this to test:

     

     

    Set
    (
     myCertCollection
     ,If
     (
     User().Email = LookUp('Staff Certifications', Person.Email).CorrectColumn
     ,Filter('Staff Certifications', Certification.Value && Status.Value = "Certification Active")
     ) 
    );

     

    Your Staff Certifications record result column containing the Email may not be called Email. Replace CorrectColumn above with what is appropriate and results in the email column you are looking for in that LookUp Record result.

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard