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 / After If statement str...
Power Apps
Answered

After If statement string value not showing but number value does

(0) ShareShare
ReportReport
Posted on by 28

Does anybody know what I am doing wrong? Also how can I make it so that I don't have to use the Value() function al the time?

 

This works:

If(
Value(maandenAfschrijven.Text) > 0;
Value(mdmBedrag.Text) * Value(maandenAfschrijven.Text) / loopTijd;
Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text) <= Value(restwaarde.Text);
1 + 1;
Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text)
)


But this doesn't

If(
Value(maandenAfschrijven.Text) > 0;
Value(mdmBedrag.Text) * Value(maandenAfschrijven.Text) / loopTijd;
Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text) <= Value(restwaarde.Text);
"Betaal alleen restwaarde!";
Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text)
)

Categories:
I have the same question (0)
  • rebeccas Profile Picture
    2,591 on at

    I'm sorry but unless my eyes are playing tricks on me I don't see any difference between the two statements you have above. Can you explain further on that?

     

    As for the Value() <-- I do normally still put mine as you have. But you can set your Text Input to Number format instead of Text and then just have TextInput1 * TextInput2 and it works without the Value on everything. I have only used it when displaying so you could possibly still need it in a place or two when actually Patching to your data source, I have not tested that side yet.

  • Beaujon1 Profile Picture
    28 on at

    Hey thanks for your response. I've edited the initial post. It's about the string: "Betaal alleen restwaarde!". It isn't showing on my text label.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Beaujon1 

    If you get tired of typing Value(), you can just use *1 That converts text to a number.  IMHO, this shortcut makes formulas much easier to read.

    My 10th grade English teacher told us "Brevity is the soul of communication".

  • rebeccas Profile Picture
    2,591 on at

    It is because the first half you asking it to show a text - "Betaal alleen restwaarde" and the second half you asking for a number. Change it to this and should be good:

     

    If(
    Value(maandenAfschrijven.Text) > 0;
    Value(mdmBedrag.Text) * Value(maandenAfschrijven.Text) / loopTijd;
    Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text) <= Value(restwaarde.Text);
    "Betaal alleen restwaarde!";
    Text(Value(mdmBedrag.Text) * Value(restwaarde.Text) / Value(aanschafprijs.Text))
    )

  • Beaujon1 Profile Picture
    28 on at

    I mean that when I do the first formula with 1+1 the text label shows 2. But when I use "Betaal alleen restwaarde!" the text label is empty.

  • rebeccas Profile Picture
    2,591 on at

    It is because you currently have it showing a number value. That is why the number response works but not the text. You need to make it where either option it can show (the number or the text) is either both numbers or both text. Since you can't make the text a number you have to make the number show as a text value. When I tested it on my end that fixed it for me. 

  • Beaujon1 Profile Picture
    28 on at

    Hey Rebeccas thanks for your time. But what determines what kind of value the text label can show? I've already set it to string. I've added a screenshot.Schermafbeelding 2020-12-21 om 15.56.41.png

  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at

    HI @Beaujon1 ,

    @rebeccas is correct in the approach - you need the field to have a consistent value - and this can only be Text as one of your options it Text. Also to save a bit of typing, you can do it this way

    With(
     {
     wMdm:Value(mdmBedrag.Text),
     wMaa:Value(maandenAfschrijven.Text);
     wRes:Value(restwaarde.Text);
     wAan:Value(aanschafprijs.Text)
     },
     If(
     wMaa > 0;
     Text(wMdm * wMaa / loopTijd);
     wMdm * wRes / wAan <= wRes;
     "Betaal alleen restwaarde!";
     Text(wMdm * wRes / wAan)
    )

     

    Please click Accept as solution 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 Thumbs Up.

  • Beaujon1 Profile Picture
    28 on at

    Thank you very much for the clarification, that worked. So I changed one part of the formula to Text(Value(mdmBedrag.Text) * Value(maandenAfschrijven.Text) / loopTijd); 

     

    Also @rebeccas thank you very much.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard