How to trim "Surname" text (remove all characters except the 1st one) and display "S." only

Options
I need to return trimmed surname in endpoint.
Ive tried to search documentation  but I haven't found exact solution for my case.

Thank you

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     I might combine a couple filters. First, split - you can take your text string and transform it to an array. Likely use a space as a separator. Secondly, the filter last to return the last entry of the array which would be the last name.

    [CleanShot 2022-02-07 at 16.59.28.png]
    If you are comfortable with Regex you may also consider leveraging that