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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to force user to t...
Power Apps
Answered

How to force user to type only caps alphabet or auto correct after typing to caps

(0) ShareShare
ReportReport
Posted on by 2

working on power app for teams

 

User has to fill and edit form (It can be new or it can be edit of old records)

 

Is it possible to force user to type caps,

OR 

After update of the field can the text be converted all the alphabets to caps.

 

Please guide 

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

    Noted your advise.

     

    Generally in Ms Access VBA programming, In such situation where all the field in the form need to do some changes, then we use to write as below, a type of loop

     

    Dim ctlMyControl As Control
    For Each ctlMyControl In Me
    If ctlMyControl.ControlType = acTextBox Or ctlMyControl.ControlType = acComboBox Then
    ctlMyControl.BackColor = vbWhite
    End If
    Next ctlMyControl
    Me.ECode.SetFocus
    End If

     

    Therefore, was expecting some thing like this.

    As it will be a big task to edit all.

     

  • Kirkby Profile Picture
    647 Moderator on at

    varText is not just a momentary snapshot, but a continuously updating value that remains alive and keeps changing by the codes you have written consecutively . Many fields that utilize it refer to the value of the last final state, which has been continuously updated.

  • Kirkby Profile Picture
    647 Moderator on at

    Hi @MIA27 

     

    1. Of course, you need to write the name of the control where the event is happening.

    Please input your control name(InputTextField ?).

    The TextInput2 is just a name of the field that I used for this example. 

    The logic above runs when an event occurs in a text field, the event takes its text value and put it into a variable, then use that variable to fill the text field itself again.

     

    2. If you use varText as a common variable for all the input Text fields, all the text in each field will change to the converted result of last input value (eg. DataCardValue22 , your last code)because all the fields refer to the varText. You need to define a separate variable for each field and assign that variable to use it.

     

     

    Kirkby

  • MIA27 Profile Picture
    2 on at

    Dear Kirkby,

    Thank you for your advise.

    Need to have below clarification from your side 

     

    a)

    Your code 

    OnChange of InputTextField: UpdateContext({varText:Upper(TextInput2.Text)});

    Here as per the code

    InputTextField is a field where the on change event trigger if user changes the value

    TextInput2.Text is the another field where the changes happens.

    BUT what what InputTextField itself, to its own. if the user type lower case here.

     

    Confused, as if needs to apply this it should trigger the code on the textField of its own.

    I mean For example 

    TextInputBox1  -  the code to remain on change property of its own. so user type in TextInputBox1 and once he                                      leaves the field, the changes to happens, not to dependent on other field change

     

    Please explain if I am wrong understanding.

     

    B)

    Issue is of All the Edit Form. All the Edit Form as TickMark Icon to Save the data.

    It will be ok, if we use the code this icon, so user has to move to next, before it goes the code triggers to update all the field in the EditForm

    Example 

    UpdateContext({varText:Upper(DataCardValue18.Value)

    UpdateContext({varText:Upper(DataCardValue19.Valuet)

    UpdateContext({varText:Upper(DataCardValue20.Value)

    UpdateContext({varText:Upper(DataCardValue21.Value)

    UpdateContext({varText:Upper(DataCardValue22.Value)

     

    Please guide, if method is ok, then in trigger, all is getting updated and saved

     

     

  • Kirkby Profile Picture
    647 Moderator on at

    Hi @MIA27 

     

    There are a huge number of input controls on the screen. 

     

    If it is possible to use "Upper(Self.Text)" in the Default property of all controls, that could make the work easier and eliminate repetitive tasks, but it doesn't work because of the occurrence of recursive calls. To avoid this situation, using individual variables is necessary, so there may not be a simpler way to write the code. Even if I try to create a collection and put the TextField contents into the collection through some processing, and then batch check and convert to uppercase, it inevitably comes back to using variables, making it difficult to simplify the code.

     

    If you were to save data using Patch instead of a relatively simple SubmitForm, you would only need to apply the Upper function to all fields, which would make the process relatively simpler. However, this action happens in the backend, invisible to the user.

     

    Kirkby

  • MIA27 Profile Picture
    2 on at

    Dear Kirkby,

     

    I noticed that I have to apply the code to each control of the edit form. Currently I am having around 52 fields in the edit form, Will have to apply 52 times,

     

    Is there a way to apply the code on the whole edit form.

    To save time.

    As my plan is the apply on several screen's Edit form. It will too much time consuming

     

     

     

     

  • Verified answer
    Kirkby Profile Picture
    647 Moderator on at

    @MIA27 

    If you you want to inform users without auto correction, you can use a label next to the inputTextField like this

     

    Text property of your Information label: 

     If(

        IsMatch(TextInput2.Text, "[A-Z/0-9]+$"),
        "Valid",
        "Invalid: Accept only uppercase letter and digits"
    )

     

    Thanks
     
    Kirkby
  • Verified answer
    Kirkby Profile Picture
    647 Moderator on at

    Hi @MIA27 

    Default of InputTextField: varText

    OnChange of InputTextField: UpdateContext({varText:Upper(TextInput2.Text)});

    //OnChange is triggered when the cursor moves from the InputTextField to somewhere else.

     

    If you need to modify existing data, initialize varText with the previously stored value in OnVisible of the screen

     

    Kirkby

     

     

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
Kalathiya Profile Picture

Kalathiya 403

#2
WarrenBelz Profile Picture

WarrenBelz 338 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 320 Super User 2025 Season 2

Last 30 days Overall leaderboard