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 for...
Power Apps
Answered

Incompatible types for comparison. Number and Text

(0) ShareShare
ReportReport
Posted on by 47

Hi all,

 

This is my first attempt at making a Power App. My goal is a make a simple app for our warehouse staff to report production. I'm using the built in barcode scanner. Ideally they will simply scan a barcode, enter the number they produced, along with their name, and then click submit. This will then email their manager with the production report for verification.

 

I've uploaded a spreadsheet with a table called 'AllCodes' which is to translate the barcodes (column A "BCode"), to product code (column B "ProductCode), description (column C "Description") and UOM (column D "BaseUOMCode").

 

At my current level of understanding, I have managed to write LookUp functions, which can successfully search and return values for both description and UOM when I manually enter a product code. I seem to be running into issues comparing the output of the barcode scanner to my table, which should return the product code. I can't seem to get a scanned bar code to match in this table.

 

Thank you in advance for your assistance.

 

2022-07-11 10_06_38-Power Apps and 1 more page - Work - Microsoft​ Edge.png

 

Default value for 'Product Code':

 

LookUp(AllCodes,BCode = BarcodeScanner1.Value).ProductCode

 

Default value for 'Description' (works):

 

LookUp(AllCodes,ProductCode = ProdCode.Text,Description)

 

 Default value for 'UOM' (works):

 

LookUp(AllCodes,ProductCode = ProdCode.Text,BaseUOMCode)

 

 

Categories:
I have the same question (0)
  • 365-Assist Profile Picture
    2,324 Moderator on at

    Sounds like you are trying to compare a Text Value to a Number Value. Try using the Value function to convert the Text to a number Value function in Power Apps - Power Platform | Microsoft Docs

    --------------------------------------------------
    Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful as can help others.

    Subscribe: https://www.youtube.com/channel/UCFpvUlpx84FuIPOdInGKMTw
    Twitter: https://twitter.com/assist_365

    Regards
    Darren Lutchner - 365 Assist

  • Bokaboi Profile Picture
    47 on at

    Hi Darren,

     

    Thank you for taking the time to reply.

    I did have a good search through the forums, prior to posting. It seems this is a common issue for beginners, myself being no exception. I did have a try wrapping the search value, and the table value in a 'Value' or 'text' function.

    Example with value function:

    LookUp(AllCodes,Value(BCode) = BarcodeScanner1.Value).ProductCode

    I can understand how it would trip people up - I'm familiar with the VLOOKUP function in excel, which just seems to work regardless of the cell format. So that is my frame of understanding.

    I've created a text label in PowerApps to output the value from the Barcode Scanner. To me it would seem to be a number, and thus I can't understand why it wouldn't be able to match the data in the table.

     

    Text label:

    2022-07-11 11_15_10-Power Apps and 2 more pages - Work - Microsoft​ Edge.png

     

    Data in table (formatted as numbers):

    2022-07-11 10_58_14-Barcodes - Excel.png

     

    App:

    2022-07-11 11_11_16-App Screen.png ‎- Photos.png

     nbsp;i9

  • Verified answer
    Bokaboi Profile Picture
    47 on at

    Hi Darren (and future readers).

    The following code in default has resolved the matter.

    LookUp(AllCodes,Text(BCode) = Label2.Text,ProductCode)

     

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

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,055

#2
Valantis Profile Picture

Valantis 666

#2
11manish Profile Picture

11manish 666

Last 30 days Overall leaderboard