Forcing upper case letters in a datacard or text field entry

  • Forcing upper case letters in a datacard or text field entry

    Posted by John Heck on January 23, 2023 at 4:38 pm
    • John Heck

      Member

      January 23, 2023 at 4:38 PM

      Hello,
      Trying to figure out how to force upper case letters in a datacard or text field entry.  I have a couple of datacards that I want to have forced to upper case on a form.  The user needs to be able to see the entries in all upper case before they submit the form.  A SubmitForm() is used to submit the form and write the data to the Azure SQL back end. 

      I have another screen that the user can enter information into text boxes and I use the Upper() function in the Patch() to force the entry to upper case.  Though it would be nice to have the user be able to see the case of the data entry, all upper case, before they submit the form.

      Thanks in advance for your assistance.

      ——————————
      Kind regards,
      John Heck
      ———————–
      ——————————

    • Larry Heimendinger

      Member

      January 24, 2023 at 3:03 PM

      Without trying to verify this, you might want to use the Upper() fuction in the OnChange or even the OnSelelct prooperty of othe field in the datacard to show the user the changed value.

      OTOH, I am often surprised at how something seemingly obvious iin approach fails in practice

      ——————————
      Larry Heimendinger
      larry@techevents.com
      EverettWA
      ——————————
      ——————————————-

    • Ed Bellman

      Member

      January 25, 2023 at 11:17 AM

      This isn’t a perfect or elegant solution [EDIT – see Warren’s below], but it works – 

      Insert a Label (Label11 in screenshots) and Text Input field (TextInput1). Arrange them so that the X,Y values are the same in the canvas and in the Tree view on the left, make sure the Text Input field is above the Label so that it will receive the focus from the tab or mouse selection.

      Set the following properties:

      • TextInput1
        • Color – transparent (use the picker or just set the A value of RGBA to 0)
        • Fill Color – transparent
        • Hover Color – transparent
        • Hover Fill – transparent
        • Maybe Pressed and Focus colors as well?
      • Label11
        • Text = Upper(TextInput1.Text)
        • X = TextInput1.X
        • Y = TextInput1.Y
        • Width = TextInput1.Width

      Test in play mode


      Edit mode, after test, with fields un-stacked and TextInput1 Color set back to Black.


      Downside – you can’t see the cursor in the TextInput field since it is transparent, but if you select and just start typing it works.

      Hopefully this helps or sparks other ideas.
      Ed

      ——————————
      Ed Bellman
      Principal Consultant – Power Apps
      ——————————
      ——————————————-

    • Warren Belz

      Member

      January 26, 2023 at 1:54 AM

      Hi ,
      If it is OK for them to see lower case while entering, but have it switch and save to upper case, then ?OnChange of the Text Box

      UpdateContext({varUpper: Upper(Self.Text)});
      Reset(Self)?

      Default (assuming you want to also display existing values if they are present and not change them)

      Coalesce(varUpper, Parent.Default)

      DelayOutput

      true

      OnSuccess of Form and screen OnVisible

      UpdateContext({varUpper: Blank()})

      ?See below

      changes to upper case

      ——————————
      Warren Belz
      MVP (Business Applications)
      Australia
      ——————————
      ——————————————-

    • John Heck

      Member

      February 6, 2023 at 2:23 PM

      Hello , thanks for the solution.  It works great.  Sorry it took me so long to test it and get back with you.  Really appreciate the help.?

      ——————————
      John Heck
      ——————————
      ——————————————-

    • John Heck

      Member

      February 6, 2023 at 2:25 PM

      Hello @Ed Bellman, your solution worked as well though the users didn’t like not being able to see the cursor to know which field they were in.  I do appreciate the assistance with this.?

      ——————————
      John Heck
      ——————————
      ——————————————-

    • John Heck

      Member

      February 6, 2023 at 2:04 PM

      Hello , I cannot get the Upper() function to work that way.  This was one of the first things I tried.

      Thanks for the suggestion.  I do wish it was that simple or at least have a switch to force upper case would be nice.?

      ——————————
      John Heck
      ——————————
      ——————————————-

    • Warren Belz

      Member

      February 7, 2023 at 1:35 AM

      Disregard . . .
      ——————————————-

    • Dean Morgan

      Member

      February 7, 2023 at 9:05 AM

      I tried the following and it seemed to work;

      Set the Text input field OnChange to:
      Set(vtext,Upper(TextInput1.Text))

      Then set the default of the TextInput1 textbox to vtext
      Finally, set DelayOutput true

      That allows me to type into the text field and it only changes to upper after a delay.

      ——————————
      Dean Morgan
      Azure Architect
      Irmo
      ——————————
      ——————————————-

    • John Heck

      Member

      February 8, 2023 at 3:31 PM

      Hello , thank you for your input.  gave the same solution just a few more steps that made it work exactly as I wanted it to.  Though it would be so nice to have Microsoft to add a switch on the data card field that would force upper case.

      ——————————
      John Heck
      ——————————
      ——————————————-

    John Heck replied 1 year, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Forcing upper case letters in a datacard or text field entry’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for people  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!