Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Issue - The value 'Label' cannot be converted to a number
    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
  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Issue - The value 'Label' cannot be converted to a number
    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
     
  • MooseBot88 Profile Picture
    144 on at
    Issue - The value 'Label' cannot be converted to a number
    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?
  • JeckGill Profile Picture
    242 on at
    Issue - The value 'Label' cannot be converted to a number

    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

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard