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 / Value function convert...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on 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

Categories:
  • Verified answer
    developerAJ Profile Picture
    4,763 on at
    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

  • jamezm79 Profile Picture
    18 on at

    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)

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard