You would need to look at using a substring.
So something like...
substring($entity/Firstname, 0, 1) + '.' +$entity/Surname
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.