How to get unique names from text box or data label control

  • 4 November 2020
  • 1 reply


I have a scenario where the REST api response returns a field like below - 

"TeamMembers": “FirstName1 LastName1 FirstName2 LastName2 FirstName3 LastName3”and so on … .

There might be n no. of team member names in this. 

In K2 Designer view/form, when I transfer this data (via REST smartobjects) -

in textbox control it looks like-

“FirstName1 LastName1FirstName2 LastName2FirstName3 LastName3” 

and in data label control it displays with line breaks like -

FirstName1 LastName1

FirstName2 LastName2

……. etc

I want to get the count of the “team members names” . I am unable to find out a string format operator or method to get individual names in K2 and get the count .

How to achieve this ?



Best answer by chaa 5 November 2020, 02:11

View original

1 reply

I got it working by using javascript. Could not find any out of the box K2 text formatting method.