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 / Lost with LOOKUP funct...
Power Apps
Answered

Lost with LOOKUP function & AND function

(0) ShareShare
ReportReport
Posted on by 30

Hi,

I'm updating an app for more security in it.
I have some trouble with a formula :

If(IsBlank(DataCardValue14) And LookUp(ADMINISTRATIF; DataCardValue12.Text in 'S/N PC'; DataCardValue12.Text) = DataCardValue12.Text

;SubmitForm(EditForm1); UpdateContext({Alert: true}));;Clear(SplitScan)


So in english i would like something like :

If datacard14 is blank and in the colum S/N PC  of my "administratif" table there is the same value than in datacardvalue 12 
then update alert on true

if not submit form


(clearscan is independant)

hope someone have an good idea with that.

(it's an app for inventory because we are tired of GLPI and other)

Categories:
  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi,

    can you please let me the the column which you want to compare with datacardvalue12 and the column type - text, choice, multi select choice, user, etc

    in the below formula you will have to replace columnName with that column

    If(IsBlank(DataCardValue14) And LookUp(ADMINISTRATIF; DataCardValue12.Text in 'S/N PC'; ColumnName) = DataCardValue12.Text

    ;SubmitForm(EditForm1); UpdateContext({Alert: true}));;Clear(SplitScan)

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @arthurbeaulieu,

    Do you want to check if the DataCardValue12 text exists in the 'S/N PC' column from your ADMINISTRATIF table?

     

    If so, I think you could directly compare the DataCardValue12 text with 'S/N PC' column using the "=" operator as below:

    If(IsBlank(DataCardValue14.Text) And IsBlank(LookUp(ADMINISTRATIF; DataCardValue12.Text = 'S/N PC')) 
    ;SubmitForm(EditForm1); UpdateContext({Alert: true}));;Clear(SplitScan)

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @arthurbeaulieu 

    I agree with @v-qiaqi-msft , almost

    If(IsBlank(DataCardValue14.Text) And IsBlank(LookUp(ADMINISTRATIF; DataCardValue12.Text = 'S/N PC'))
    ;SubmitForm(EditForm1));;

    Clear(SplitScan)

    Move UpdateContext({Alert: true}) to the OnSuccess property of the form so it doesn't execute until the form is submitted successfully. Consider moving the Clear(SplitScan) too if it's also a condition of the successful submission.

  • Verified answer
    arthurbeaulieu Profile Picture
    30 on at

    Hi everyone thanks for your reply. I finally find something that work : 

    If(LookUp(ADMINISTRATIF; DataCardValue12.Text in 'S/N PC'; "OK") <> "OK" || LookUp(ADMINISTRATIF;DataCardValue14.Text in ID; "OK") = "OK"

    ;SubmitForm(EditForm1); Set(varquit;UpdateContext({Alert:true})));;Clear(SplitScan)

    Everything is working fine

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 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard