how to append single quote using glidefunction.concat

PatriciaA987250
Tera Expert

Hi,

 

I want to append single quote infront of the employee id  (i.e. '00012345) using the the glidefunction:concat. I tried to escape the value with both back and forward slash but it return invalid function, Kindly provide sample, on how to concat single quote using glidefunction:concat.

 

tried code:

glidefunction:concat('/'', emp_num)

2 ACCEPTED SOLUTIONS

Jean-Emmanuel
Tera Guru

Hello,
You can use the following syntax: 
glidefunction:concat("'",emp_num).

Ex: In this exemple I concat single quote and incident number:
Screenshot 2024-08-15 at 09.57.46.pngScreenshot 2024-08-15 at 09.58.31.png

 

If this clarifies your question, please mark this response as helpful!

View solution in original post

HIROSHI SATOH
Mega Sage

Using double quotes:
You can also enclose the string in double quotes. In this case, you can include a single quote without escaping it.

 

HIROSHISATOH_0-1723708984026.png

 

HIROSHISATOH_2-1723709021556.png

 

 

 

 

View solution in original post

4 REPLIES 4

OlaN
Giga Sage
Giga Sage

Hi,

What wrong with just adding the strings together with a simple + operator ?

Like so:

var empNumber = "0123456";
var prefix = "'";

var concatBothValues = prefix + empNumber;
gs.info('concatinated: ' + concatBothValues);

// result ->> concatinated: '0123456

 

Jean-Emmanuel
Tera Guru

Hello,
You can use the following syntax: 
glidefunction:concat("'",emp_num).

Ex: In this exemple I concat single quote and incident number:
Screenshot 2024-08-15 at 09.57.46.pngScreenshot 2024-08-15 at 09.58.31.png

 

If this clarifies your question, please mark this response as helpful!

HIROSHI SATOH
Mega Sage

Using double quotes:
You can also enclose the string in double quotes. In this case, you can include a single quote without escaping it.

 

HIROSHISATOH_0-1723708984026.png

 

HIROSHISATOH_2-1723709021556.png

 

 

 

 

abirakundu23
Mega Sage

Hi @PatriciaA987250 ,

Please try below one & it's working fine in PDI.

abirakundu23_0-1723709868638.png


Please mark helpful & correct answer if worthy for you.