get character from string

0
In an entity I have a variable called: FirstName and a variable called Surname. I want to add another variable where I get the first letter of the FirstName + '.' + Surname. So for example: John Matthews will become J.Matthews. How can i collect the first letter of John in this case? In a microflow I can't get further than: $entity/Firstname+'.’+$entity/Surname
asked
2 answers
3

You would need to look at using a substring.

So something like...

substring($entity/Firstname, 0, 1) + '.' +$entity/Surname

 

answered
1

You’re looking for the subtring functionality:

(
    if length($Entity/Firstname) > 0
    then substring($Entity/Firstname, 0, 1) + ‘.’
    else ‘’
)
+
$Entity/Surname

---

The length check is added because attempting to crete a substring longer than the original string results in an error.

answered