Announcement

Collapse
No announcement yet.

Problem with upper and lower case

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with upper and lower case

    Hello all,

    I just have a little beauty problem.
    We also have entities that are not just one word.
    The problem is that the second word is always lowercase.

    In the entity manager it is spelled correctly, but somehow it doesn't want to be capitalized.

    How to improve this blemish?
    Since this is also used in the notification emails and there also the first word capitalized and then lowercase from the second.​
    Attached Files

  • #2
    Use formula to convert it to the type you want?

    Comment


    • #3
      Would already work.

      BUT: after these commands I get the complete word in only small or big letters.

      But I want every word to start with a capital letter.

      At the moment I get: Function sheet
      But the correct should be: Function Sheet

      In the LabelManager is for example this entry:
      {user} has {entityType} {entity} assigned to {assignee}

      How do I tell that there now, that each word should start with a capital letter?​

      Comment


      • #4
        There is no TitleCase option, you have to create a new formula for that I guess. Alternatively you can use regular expression and search to get it done but this might be more of a hassle.

        Alternatively you can do a feature request, but right now Yuri want to go hibernate with some backlog and feature request is usually slower than bug fix.

        Sadly I can't help, you need a coder for the easier solution TitleCase as I think it is quite a standard code.
        Last edited by esforim; 06-07-2023, 04:56 AM.

        Comment


        • #5
          Perhaps it will come in handy for someone, but in EspoCRM, thanks to the formula, you can remake a string so that every word in it begins with a capital letter.

          This option may seem rather confusing and perhaps it can be simplified, but this is just a quick workaround.

          In the first line, enter your string into the $name variable, and as a result, you will get the desired output in the $fullName variable. I recommend trying it first in Formula Sandbox.
          Code:
          $name = 'test entity one';
          
          $nameArray = string\split($name, ' ');
          
          $newArray = list();
          
          $i = 0;
          
          while(
              $i < array\length($nameArray),
              (   
                  $firstString = array\at($nameArray, $i);
                  $firstLetter = string\upperCase(string\substring($firstString, 0, 1));
                  $anotherLetters = string\substring($firstString, 1, string\length($firstString));
                  $fullWord = string\concatenate($firstLetter, $anotherLetters);
                  
                  $newArray = array\push(
                      $newArray,
                      $fullWord
                  );
                  
                  $i = $i + 1;
              )
          );
          
          $fullName = array\join($newArray, ' ');

          Comment


          • esforim
            esforim commented
            Editing a comment
            Wow! Thank you!

        • #6
          Just tested the formula above. It seem to be working but only if the text is lowercase, I'm too weak to fix it up so I did a dirty string\lowercase trick:

          Click image for larger version

Name:	image.png
Views:	237
Size:	84.3 KB
ID:	94242

          Comment


          • #7
            Alternative:

            Here is my poor-formula version, it weakness is it only grab the 1st word which is fine for me but the code is less scary and shorter. Hopefully we get string\titleCase() in future update.

            $addressCity2=string\upperCase(string\substring($a ddressCity1, 0, 1));
            addressCity=string\concatenate($addressCity2, string\substring($addressCity1,1,));

            Comment

            Working...
            X