Skip to main content

Notifications

Community site session details

Community site session details

Session Id : mfU1kdofzCeYSP0XWgw8vi
Power Apps - Building Power Apps
Unanswered

How to suppress comma at Canvas app text field

Like (0) ShareShare
ReportReport
Posted on 10 Dec 2020 00:31:04 by 6

Friends, 

 

We have a need to suppress comma "," while text field keyboard entry in a canvas application inorder to avoid getting commas persisted to the CDS. 

 

for example "Customer Address" Text field should not be allowed to have commas in it.

 

This is urgent, please help. 

 

please suggest

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 10 Dec 2020 at 16:01:36
    Re: How to suppress comma at Canvas app text field

    @RajendraKumar 

    I am not sure if the logic here is the behavior that you expect:

    With({dcv:Substitute(DataCardValue3_1.Text,",","")},
     If(
     Len(dcv) = 8 || Len(dcv) = 10, SubmitForm(CreateRequestEntry),
     Notify("Your data has been accepted",NotificationType.Success, 4000
     ); Navigate(ReviewListScreen, None
     ),
     Notify("Improper data format",NotificationType.Error
     ),
     ),
    )

    This should create a temporary variable that strips the commas from the  DataCardValue text input box.

    Then if the length of the variable is either 8 or 10, it will submit the form, notify the user that the data was accepted and navigate to the next screen.  If the length of the variable is not 8 or 10, it will notify the user that the data is improper.

  • RajendraKumar Profile Picture
    6 on 10 Dec 2020 at 03:02:37
    Re: How to suppress comma at Canvas app text field

    Thanks Drrickryp,

     

    I have put below code at OnSelect of a button on a canvas. Any idea why it does not execute the first line?

    if block, from second line,  executes but not the first line. if block creats a record at CDS.

     

    DataCardValue3_1.Text=Substitute(DataCardValue3_1.Text, ",", "");

    If(
    Len(DataCardValue1_1.Text)<> 8 Or Len(DataCardValue12_1.Text) <> 10, Notify("Improper data format",NotificationType.Error),
    If(
    SubmitForm(CreateRequestEntry),
    Navigate(
    ReviewListScreen,
    None
    ),
    true
    )
    );

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 10 Dec 2020 at 00:40:08
    Re: How to suppress comma at Canvas app text field

    Hi @RajendraKumar 

    Substitute(TextInput1.Text, ",", "")

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 48 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard
Loading started