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 / "Incompatible Types fo...
Power Apps
Answered

"Incompatible Types for Comparison: Table, Text" Error when comparing Gallery "Label.Text" with List column in LookUp function

(1) ShareShare
ReportReport
Posted on by 195

When comparing "Label.Text" from a gallery with List column in "LookUp" function it gives error Incompatible Types for Comparison. These types can't be compared:Table, Text

 

Formula:

 

 

Collect(
 HSEScoreValues,
 {
 Project_Name: Value(DataCardValue1.Selected.Value),
 Survey_Date: DataCardValue2.SelectedDate,
 Category:LookUp('HSE-CategoryQuestion','HSE-CategoryQuestion'.Question=QuestionLabel.Text,'HSE-CategoryQuestion'.Category)
 }
)

 

 

 

In above LookUp formula:

 

HSE-CategoryQuestion is the list with text(choice) columns "Question" & "Category"

QuestionLabel is Text Label in Gallery connected to the list "HSE-CategoryQuestion" fetching the "Category"  column values

 

so Error occurring here:

 

LookUp('HSE-CategoryQuestion','HSE-CategoryQuestion'.Question=QuestionLabel.Text,'HSE-CategoryQuestion'.Category)

 

'HSE-CategoryQuestion'.Question=QuestionLabel.Text

 

akg1421_0-1627449915966.png

 

What's the work around? @RandyHayes @WarrenBelz @Pstork1 @rubin_boer @CNT @BCLS776 @zmansuri @Drrickryp @timl @Ramole @BCBuizer 

Edit: I tried with 

 

LookUp('HSE-CategoryQuestion',Question=QuestionLabel.Text,'HSE-CategoryQuestion'.Category)

 

It stores "Category" as Table like data in collection.... "Category" column expands to multiple rows of Category. Also Project_Name is empty (in above function Project_Name: Value(DataCardValue1.Selected.Value))

 

akg1421_0-1627457933693.png


Plz guide regarding this issue!

Update: Solved with 

Category: LookUp(
 'HSE-CategoryQuestion',
 Question = QuestionLabel.Text,
 ThisItem.Category
 )
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    @akg1421 ,

    Try this for a start

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:
     LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category
     }
    )

     

    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.

  • amk1421 Profile Picture
    195 on at

    @WarrenBelz I tried with: 

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:LookUp('HSE-CategoryQuestion',Question=QuestionLabel.Text,'HSE-CategoryQuestion'.Category)
     }
    )

    It stores data in collection but in "Category" it is storing a "table" like data and "Project_Name" is blank whereas DataCardValue1.Selected.Value is from dropdown and it is picking up the selected value

     

    Snap 2021-07-28 at 12.09.55.png

     

    Here "Category" column expands to:

    akg1421_1-1627456653380.png

     

     

    Your suggested formula is not returning anything the collection stays empty

     

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:
     LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category
     }
    )

     

     

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    @akg1421 ,

    Assuming Category in 'HSE-CategoryQuestion' is a Choice field

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:
     LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category.Value
     }
    )

    or

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:
     LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text,
     Category.Value
     )
     }
    )

     

    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.

  • amk1421 Profile Picture
    195 on at

    @WarrenBelz With both formulas its error "Function LookUp has some invalid arguments" 

    LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category.Value
    LookUp(
    		 'HSE-CategoryQuestion',
    		 Question=QuestionLabel.Text,
    		 Category.Value
    )

     

    It is not accepting "Category.Value" because Category is the list column (choice field). But in powerapps shouldn't it be returning only "texual" values? For example Category was "Some category" and in Lookup we match it with QuestionLabel.Text so it should return first matching record from Category column i.e. value "Some category"

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    @akg1421 ,

    From your output (which is strange) try

    Collect(
     HSEScoreValues,
     {
     Project_Name: Value(DataCardValue1.Selected.Value),
     Survey_Date: DataCardValue2.SelectedDate,
     Category:
     LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category.Title
     }
    )

     

    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.

     

  • amk1421 Profile Picture
    195 on at

    @WarrenBelz It does not accept anything beyond Category , after dot

    LookUp(
     'HSE-CategoryQuestion',
     Question=QuestionLabel.Text
     ).Category.Title


    akg1421_0-1627475944192.png

     

  • Verified answer
    amk1421 Profile Picture
    195 on at

    Solved by using "ThisItem"

    Category: LookUp(
     'HSE-CategoryQuestion',
     Question = QuestionLabel.Text,
     ThisItem.Category
     )

     

     

  • WarrenBelz Profile Picture
    155,240 Most Valuable Professional on at

    @akg1421 ,

    That is not obvious from the information in your post - you must be running the button or icon code from inside a form or gallery for that reference to be possibly valid and your last post was even more confusing as you had a field Title in the metadata of the category table (you posted HSEScoreValues.Category which showed this). The error also reflected that this was a table incompatible Types for Comparison. These types can't be compared:Table, Text.

    I am glad you got it sorted, but the solution required more information than provided at the time.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 627

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard