Custom 30th string character

Hi guys, I have a question. Theres an attribute called ‘’FullName’’, wich have unlimited lenght, but, if the user enter more than 30 characters I want to trim/cut/limit that to the last 30th character in the microflow without setting a custom 30 lenght directly on the input ‘’fullname’’ field. Any help?
1 answers

You can use the substring function to limit the length of the string. Add a check before to see if you need to do this by checking the length with the length function.

If you have string in the $MyString variable, something like this should work.

if (length($MyString) > 30) then
  substring($MyString, 0, 30)