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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Issue - The value 'Lab...
Power Apps
Unanswered

Issue - The value 'Label' cannot be converted to a number

(0) ShareShare
ReportReport
Posted on by 242


I keep getting this error message and I am not exactly sure why. 
 
Clear(col_galleryPurchase);
ForAll(
    Gallery2_3.AllItems,
    Collect(
        col_galleryPurchase,
        {  
            RowNum: CountRows(col_galleryPurchase) + 1, // Add a RowNum column here
            'Item Name': Text(ThisRecord.TextInput1_6.Text),
            'Item Description': Text(ThisRecord.TextInput1_7.Text),
            'Nominal Code GUID': ThisRecord.nominalCodeGUID.Text,
            'Delivery Date': If(Checkbox1_5.Value, ThisRecord.DatePickerCanvas1.SelectedDate, DatePickerCanvas2.SelectedDate),
            'Quanity Units': ThisRecord.UnitType.Selected.Value,
            'Unit Pricing': ThisRecord.UnitPrice_1.Selected.Value,
            'Number of Units': Text(ThisRecord.itemQty.Text),
            'Price per/Unit': Text(ThisRecord.TextInput1_13.Text),
            'Item Net Cost': If(IsNumeric(Value(ThisRecord.Label1_14.Value)), Value(ThisRecord.Label1_14.Value), 0),
            'Discount: Individual Item': If(Checkbox1_4.Value, 1,0),
            'Discount: Amount': Text(TextInput1_14.Text),
            'Discount: Money/Percentage': orderDiscountType.Selected.Value
        }
    )
);

//get the value of the most expensive item in this PO - this will be patched to Overview
ClearCollect(
    col_nominalCode,
    Sort(
        ForAll(
            Gallery2_3.AllItems,
            {
                'Item Net Cost': Value(ThisRecord.TextInput1_13.Text) * Value(ThisRecord.itemQty.Text),
                'Nominal Code': ThisRecord.nominalCodeGUID.Text
            }
        ),
    'Item Net Cost',
    SortOrder.Descending
    )
);
Set(
    _largestNominalCode,
    First(col_nominalCode).'Nominal Code'
);
/* ----------------------------------------------------------------------- */

Set(_page2View, 1);
Set(_progressCounter, _progressCounter+1);
Navigate('3 A. Purchase Summary');
 
This is the formula I have running when it occurs. 
Even more annoyingly, everything seems to be working fine otherwise. I'm not having any red lines anywhere, and my app is working as expected.

If there isn't a way to fix it, is there at least a way for me to hide the popup from the user? 😅


cheers




edit:
(I commented this yesterday, but people missed it - didn't realise I could edit posts)

I should probably mention, I wasn't always using

If(IsNumeric(Value(ThisRecord.Label1_14.Value)), Value(ThisRecord.Label1_14.Value), 0),

I was using Value(ThisRecord.Label1_14.Value) before that. And before that again, that what a Label; it's now a Modern Text Input (I've also tried with the Modern Number Input).
It's name has since been updated to "purchItemNetCost" to see if that would fix the problem, to no avail ☹️

really running out of ideas


edit 2:

AH - so the app is set up to be launched in a mini window, on a button press in a dataverse table's command bar

(image doesn't show much but it gives an idea I guess) BUT, the popup only occurs when I use it there, or by opening the canvas app specifically to use it. It doesn't happen when I use it in developer mode and hitting the play button. Now I am just more confused

Categories:
I have the same question (0)
  • JeckGill Profile Picture
    242 on at

    I should probably mention, I wasn't always using

    If(IsNumeric(Value(ThisRecord.Label1_14.Value)), Value(ThisRecord.Label1_14.Value), 0),

    I was using Value(ThisRecord.Label1_14.Value) before that. And before that again, that what a Label; it's now a Modern Text Input (I've also tried with the Modern Number Input).
    It's name has since been updated to "purchItemNetCost" to see if that would fix the problem, to no avail ☹️

    really running out of ideas

     

  • MooseBot88 Profile Picture
    168 on at
    On this line...
     
    If(IsNumeric(Value(ThisRecord.Label1_14.Value)), Value(ThisRecord.Label1_14.Value), 0),
     
    I would assume that Label1_14 is a normal label so then this would be the code you use.
     
    If(Value(ThisRecord.Label1_14.Text)),Value(ThisRecord.Label1_14.Text), 0),
     
    Try that?
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at
    Hi JeckGill 
    Probably overkill, but using a Classic Label, try this
    If(
       Len(Label1_14.Text) = 0,
       0,
       !IsNumeric(ThisRecord.Label1_14.Text),
       0, 
       Value(ThisRecord.Label1_14.Text)
    )
    You could alternatively wrap the code in IfError and set it for 1/100 of a second so the user never sees the error.
    IfError(
       ForAll(
          Gallery2_3.AllItems,
          . . . . . . .
       ),
       Notify("xxx",NotificationType.Error,10)
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
     
  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at
    Just following up to see if you received the answer you needed, or if you require further assistance.

    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard