Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 1GEkdoydTrtI40RuSd09er
Power Apps - Building Power Apps
Answered

Value function converted an empty text to a blank value (text box in gallery control)

Like (0) ShareShare
ReportReport
Posted on 18 Aug 2023 17:52:36 by 18

Hi. I'm receiving this warning when performing validation of the user's data entered into a text box control in a gallery. The text box control is set up with the format property of 'Number' instead of text. The text box is used to collect a number between 0 and 100. I am using conditional formatting in the Color property to evaluate the number that's provided and then apply a red colour to the text if the number entered is <0 or >100 (or indeed '!IsNumeric' which shouldn't be possible with the Number format).

 

In the Monitor I see warnings (see attached example) several times when the Color property of this control is being evaluated. I've tried catching this with OnError, or using Coalesce to force a "0" value, or using an If command to pass "0". Nothing I've tried so far has worked. I know there are a few forum posts on this issue already but none of the suggested fixes have worked for me...

 

Any other suggestions please?

 

Below is an example of the code I've tried to resolve this.

=========================

 

If(
If(
Self.Text = Blank(),
0,
Value(Self.Text)
) > 100 ||
If(
Self.Text = Blank(),
0,
Value(Self.Text)
) < 0 ||
!IsNumeric(
If(
Self.Text = Blank(),
0,
Value(Self.Text)
)
),
Color.Red,
RGBA(
255,
255,
255,
100
)
)
//Coalesce(
// Value(Self.Text),
// 0
// )

 

Attached is an image showing the warning. Click to expand.

Screenshot 2023-08-18 185029.png

  • jamezm79 Profile Picture
    18 on 21 Aug 2023 at 07:02:52
    Re: Value function converted an empty text to a blank value (text box in gallery control)

    Thank you! This really helps. I no longer seem to get the warning for those particular text boxes.

     

    Any tips for making a similar correction to a related text box that calculates the sum of all of those percentage totals in the gallery? The formula for that text box is currently:

     

    Sum(galleryGrid.AllItems,txtPercentage)

  • Verified answer
    developerAJ Profile Picture
    2,855 on 19 Aug 2023 at 05:00:36
    Re: Value function converted an empty text to a blank value (text box in gallery control)
    If(
    If(
    IsBlank(Self.Text),
    0,
    Value(Self.Text)
    ) > 100 ||
    If(
     IsBlank(Self.Text),
    0,
    Value(Self.Text)
    ) < 0 ||
    !IsNumeric(
    If(
    IsBlank(Self.Text),
    0,
    Value(Self.Text)
    )
    ),
    Color.Red,
    RGBA(
    255,
    255,
    255,
    100
    )
    )

     

    or

    If(
    Coalesce(
    Value(Self.Text),
    0
    ) > 100 ||
     Coalesce(
    Value(Self.Text),
    0
    ) < 0 ||
    !IsNumeric(
    Coalesce(
    Value(Self.Text),
    0
    )
    ),
    Color.Red,
    RGBA(
    255,
    255,
    255,
    100
    )
    )

     

    both should work

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,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard
Loading started