Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to use Substring method in Inbound Action

Community Alums
Not applicable

Hi Team,

I have to use Substring function to extract order number from subject of incoming email in Inbound action of type "Record". When to run of type "Reply".

Below is the scrip I wrote to extract order number:

email var sub=email.subject.toString();

var num=substring(sub,'4','16');
gs.info("00xx: "+num);

But I am getting below error message in logs. Kindly let me know how to solve?

com.glide.script.RhinoEcmaError: "substring" is not defined.
sysevent_in_email_action.b6b0cd6d1b12c150f102866ecc4bcbc2.script : Line(7) column(0)
4: var sub=email.subject.toString();
5: //var sysid=email.from_sys_id;
6:
==> 7: var num=substring(sub,'4','16');

1 ACCEPTED SOLUTION

Anshu_Anand_
Kilo Sage
var num=sub.substring(4,16);

Try this

If its work, mark answer as correct.

Regards,
Anshu

View solution in original post

3 REPLIES 3

Anshu_Anand_
Kilo Sage
var num=sub.substring(4,16);

Try this

If its work, mark answer as correct.

Regards,
Anshu

Community Alums
Not applicable

Hi Anshul,

 

Actually I want to extract CSPRJ00000001896 from the string "Re:CSPRJ00000001896"

Please let me know what numbers , I should put in substring?

var num=sub.substring(3);

find_real_file.png

find_real_file.png

Hope its helpful

Regards,
Anshu