Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Canvas App Substitute , by .

(0) ShareShare
ReportReport
Posted on by 516
Hello,
i have a simple Textbox (classic control, no number input) named txt_akt_stunden_1.
 
I just want to substitute a , by a .
To test it i have a button that does the following "onselect":
Notify(Substitute(txt_akt_stunden_1.Value,",","."));
 
Anyway if there is 1,2 in the textbox
The substitute gives me 12 and not 1.2.
 
Also if i just notify about txt_akt_stunden_1.Value it already gives me 12.
It seems to treat it as number
But in the properties the value is 1,2
 
And to my knowledge Value(txt_akt_stunden_1.Value) should give the value?
And txt_akt_stunden_1.Value should give the text in Textbox?
 
How can i get the real text.

The reason i want to do this is that i want to save the value as the number 1.2 independent if the user uses 1,2 or 1.2 and browser settings
Any help is welcome
  • SLMR Profile Picture
    SLMR 516 on at
    Canvas App Substitute , by .
    thanks a lot !!!
    That does the trick.
     
  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 144,609 on at
    Canvas App Substitute , by .
    OK @SLMR,
    It is always good to provide that information as it will affect who may possibly respond. I do not use Model-Driven Apps, so cannot test anything other than to note that your code should work. You can try this, however that is the extent of what I can contribute
    With(
       {
          _msg:
          Substitute(
             txt_akt_stunden_1.Value,
             ",",
             "."
          )
       },
       Notify(
          _msg,
          NotificationType.Information
       )
    );
     
    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    LinkedIn    Buy me a coffee
  • SLMR Profile Picture
    SLMR 516 on at
    Canvas App Substitute , by .
    thank for your quick response.

    I forgot to mention:
    It is a canvas App but it is a custom page in a model-driven app.
    For some reasons the textboxes have other properties as in a "normal" canvas app.
    So the property Text is not there. I can only use the property Value
  • Suggested answer
    WarrenBelz Profile Picture
    WarrenBelz 144,609 on at
    Canvas App Substitute , by .
    Hi @SLMR
    If that is a Classic Control, you need .Text, not .Value
    Notify(
       Substitute(
          txt_akt_stunden_1.Text,
          ",",
          "."
       )
    );
     
    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    LinkedIn    Buy me a coffee

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

End of Year Newsletter…

End of Year Community Newsletter…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #11 New Opportunities…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,609

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,420

Leaderboard