web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : ZmzDD9gUC+SqjsDRDDzzHX
Power Apps - Building Power Apps
Answered

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

Like (1) ShareShare
ReportReport
Posted on 28 Jul 2021 05:31:20 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
 )
  • WarrenBelz Profile Picture
    148,914 Most Valuable Professional on 28 Jul 2021 at 21:36:42
    Re: "Incompatible Types for Comparison: Table, Text" Error when comparing Gallery "Label.Text" with List column in LookUp function

    @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.

  • Verified answer
    amk1421 Profile Picture
    195 on 28 Jul 2021 at 19:14:56
    Re: "Incompatible Types for Comparison: Table, Text" Error when comparing Gallery "Label.Text" with List column in LookUp function

    Solved by using "ThisItem"

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

     

     

  • amk1421 Profile Picture
    195 on 28 Jul 2021 at 12:40:25
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

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

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


    akg1421_0-1627475944192.png

     

  • WarrenBelz Profile Picture
    148,914 Most Valuable Professional on 28 Jul 2021 at 11:21:30
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

    @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 28 Jul 2021 at 10:29:44
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

    @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
    148,914 Most Valuable Professional on 28 Jul 2021 at 08:39:19
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

    @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 28 Jul 2021 at 07:18:48
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

    @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
    148,914 Most Valuable Professional on 28 Jul 2021 at 06:02:33
    Re: Incompatible Types for Comparison: Table, Text when comparing Gallery "Label.Text" with List column in LookUp function

    @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.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete