SharePoint Immersion Experience

A journey of a TSP for Collaboration

InfoPath: Converting data to Upper Case or Lower Case

InfoPath: Converting data to Upper Case or Lower Case

  • Comments 5
  • Likes

Here's the formulas to convert the data of the current textbox to UPPER case or lower case.

Convert To UPPER case
translate(., "abcdefghijklmnopqrstuvwyxz", "ABCDEFGHIJKLMNOPQRSTUVWYXZ")

Convert to lower case
translate(., "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz")

Convert first letter to UPPER case:
concat(substring(translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(., 2, string-length(.) - 1))

 

Comments
  • Useful info.

  • How do I convert first name's first letter to upper  and last name first letter's initial to upper case when they are being captured in the same field and with a space in between.

    thanks.

  • As for converting first name and last name to upper case for the first letter, I've not done it myself using formulas.

    There's someone who have done it using rules. It's pretty cool and works.

    www.infopathdev.com/.../20998.aspx

    Download the capitalize.xsn to check out the rules.

  • Awesome, I used this to translate default value by enclosing the text with quotation marks. Yes, I know why not just enter data in all caps? The source is AD display.

  • Hola, buenas tardes.

    Tuve un requerimiento por parte de un usuario en el cual desea que todas las letras, incluyendo acentos, diéresis, etc., se almacenen automáticamente en formato mayúsculas, por lo cual, les comparto la función que nos facilitará esta tarea complementando la que nos exponen al inicio del blog, la siguiente función toma en cuenta vocales y letras con acentos del tipo grave, agudo, circunflejo, tilde, anillo, ligadura, diéresis, etc.:

    translate(., "abcdefghijklmnñopqrstuvwxyzáéíóúäëïöüàèìòùâêîôûçãåæøý", "ABCDEFGHIJKLMNÑOPQRSTUVWXYZÁÉÍÓÚÄËÏÖÜÀÈÌÒÙÂÊÎÔÛÇÃÅÆØÝ")

    Gracias y saludos cordiales.
    Carlos.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment