Onsubmit client script for record producer

FaizDev101
Tera Expert
  • Created a record producer for incident table with variable "email_body" with type as multi line text.
  • When submit the form entering text as :

Room: IT Room
Location: Finland
Issue Detail: This is test issue

 

The incident table short_description should get populated with "IT Room" and description should be "This is test issue".

This should be dynamic , if I change the "Room" or "Issue detail" suffix in submit form, the following in incident table also should change.

Help me with a Onsubmit client script.

FaizDev101_0-1682598773788.png

 

FaizDev101_2-1682598816188.png

 

 

4 REPLIES 4

Aniket Narode2
Tera Contributor

Hello,

If your email_body data is fixed always then, You can try below code in record producer script:

 

var bodyDetails = producer.email_body.split(":");
current.short_description = bodyDetails[1];
current.description = bodyDetails[3];
 
Mark this helpful is it solve the issue.
 
Thanks
 

Joe S1
Kilo Sage

Hello Faiz,

 

Can you share a little more on exactly what you're trying to do? Why do you have a record producer with just an email body field? Why are you parsing out the body field to map to fields on the Incident form?

 

Thanks,

 

Joe S.

Just trying the possibility of passing the string logically through onsubmit client script, provide script if possible

 

Thanks,

 

Faiz Ahamed

 

With a Record Producer I don't think you need to use an OnSubmit client script for this. In the script field of the RP you can just call a Script Include and pass the multi-line string value to the SI and then parse the text out from there and set the fields as needed.

 

Thanks,

Joe S.