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 / Using LookUp with Upda...
Power Apps
Unanswered

Using LookUp with UpdateIf

(1) ShareShare
ReportReport
Posted on by 201

Right now I have cobbled together the following solution that is working fine.

 

I have the following UpdateIf in the OnChange property of a dropdown (DrpPrdTyp😞

UpdateIf(CollPtAPrd,Type=LblProdTypeLookup.Text,{GrpPrd:Value(1)},Type=LblProdTypeLookup.Text,{GrpPrd:Value("")})

which references (via LblProdTypeLookup.Text) the following LookUp formula (within the Text property of a Label):

LookUp(Type,DrpPrdTyp.Selected.Value=GenType).TypeType

I was hoping I could simply replace each instance of LblProdTypeLookup.Text in the DropDown formula with the entire LookUp formula above. When I try I get an "Invalid argument type" error. As a result I am having to hide the Label so I can reference it in order to make the UpdateIf work. Very clunky solution. What am I missing?

 

 

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

    Hi @AGS94 

     

    What is the datatype of "Type" in CollPtAPrd.  I think it refers to a lookup field. If so you might need the criteria as 

     

    Type.Value = LblProdTypeLookup.Text

     

    Thanks.

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

    Hi @AGS94 ,

    Since the result of this formula is a column:

    LookUp(Type,DrpPrdTyp.Selected.Value=GenType).TypeType

     While LblProdTypeLookup.Text respresents a value.

    So I suggest you try this formula:
    LookUp(Type,DrpPrdTyp.Selected.Value=GenType,TypeType)       (this formula will return a value)

    Then, replace LblProdTypeLookup.Text with this LookUp formula in your UpdateIf formula.

    Here's a doc about LookUp function for your reference:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup

     

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

     

  • AGS94 Profile Picture
    201 on at

    CollPtAPrd is a collection and the data within the columns I am working with are strings.

     

    I am trying to get rid of LblProdTypeLookup.Text  altogether and essentially nest my LookUp within the UpdateIf. My apologies if I am missing something?

  • AGS94 Profile Picture
    201 on at

    Thanks Phoebe. If I undertsand correctly, you are recommending the following?

     

    UpdateIf(CollPtAPrd,Type=LookUp(Type,DrpPrdTyp.Selected.Value=GenType,TypeType),{GrpPrd:Value(1)},Type=LookUp(Type,DrpPrdTyp.Selected.Value=GenType,TypeType),{GrpPrd:Value("")})

    If so, I am still getting the "Invalid argumant type".

     

    Did I do this right?

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

    Hi @AGS94 ,

    Could you describe more clearly about your two conditions?

    According to your formula, you use the same formula in the two conditions:

    Type=LookUp(Type,DrpPrdTyp.Selected.Value=GenType,TypeType)

    Could you tell me the data type of: Type, TypeType,GrpPrd?

    Could you show me your settings of the DrpPrdTyp? Are you sure it's drop down not combo box?

    Try this :

    UpdateIf(CollPtAPrd,Type=LookUp(Type,DrpPrdTyp.Selected.Value=GenType,TypeType),{GrpPrd:1},
    condition2,{GrpPrd:""}) //replace condition2 with your second condition

     

     

    Best regards,

    Community Support Team _ Phoebe Liu

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard