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

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Value function convert...
Power Apps
Unanswered

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:
I have the same question (0)
  • Verified answer
    developerAJ Profile Picture
    4,628 on at
    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

  • jamezm79 Profile Picture
    18 on at
    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)

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 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard