Hi All, spaces and dots are not taking in request body in scripted rest api
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 07:02 AM - edited 02-11-2024 07:13 AM
Hi All, in one of my json payload there is a field with the value as "test application", while i am trying to retrieve the data i am only getting the first name that is only test from this value test application. However i am able to create a record in my table but the problem is the record gets created with the name a only test not test application. How to avoid these spaces issues? Help me here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 12:12 AM
Use .toString(); It must help...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 12:27 AM
Hi Sohail,
You mean .toString in the scripted rest api?if yes, I already did like that if not in scripted rest api please let me know where you are suggesting to put .toString().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 01:33 AM
There might be non-printable or special characters at the end of the strings causing the truncation. Use trim() method to remove any leading or trailing whitespace.
var app_name = reqbody.application_name.trim();
var grp_name = reqbody.group_name.trim();
var operation = reqbody.typrofoperation.trim();
