Hi All,
I’m trying to add multiline description and also want to add data table rows in description while raising ServiceNow incident through API using HttpClient activities. I tried using ‘\n’ and ‘\n’, but I’m unable to do so.
This is how I wanted incident description to be -
Hi team,
We see the following blocking sessions .Please clear them immediately.
INST_ID
MACHINE
USERNAME
STATUS
SID
SERIAL#
MINS_RUNNING
SQL_ID
HASH_VALUE
BLOCKING_SESSION
BLOCKING_INSTANCE
PROCESS
4
xyz-o101b
xyzLREAD
ACTIVE
7325
265
1.15
9q5n
1868
X
Y
9552
Regards,
XYZ team
Below are the details I’ve used -
EndPoint URL - https://xyz.service-now.com/api/now/table/incident
Body -
{“short_description”:“”,
“description”:“”,
“assignment_group”:“”,
“watch_list”:“”,
“caller_id”:“”}
I’ve used Simple Authentication here.
I’m able to raise incident without new line but with new lines it’s giving error.
Can anyone please help here it’s urgent?
postwick
(Paul)
August 31, 2023, 1:06pm
2
“line one” + VbCrLf + “line two”
Hi @postwick , I’ve passed
"Hi Team, "+VbCrLf+“Please check…”
But that’s not working…
“{"error":{"message":"Exception while reading request","detail":"The payload is not valid JSON."},"status":"failure"}”
Ticket Body -
@"
{
““short_description””:““Sel - Printer””,
““description””:““Hi Team,
Please check the “”,
““assignment_group””:”“NA””,
““watch_list””:““arpit.sharma””,
““caller_id””:““RPA Bot””
}"
postwick
(Paul)
August 31, 2023, 1:28pm
4
Show us the JSON you’re trying to send.
postwick
(Paul)
August 31, 2023, 1:29pm
5
\n isn’t working because you have to escape the \ for JSON. Try \\n
instead of \n
Below is the Json data I’m trying to send -
And in Description = "Hi Team, +VbCrLf+ Please check the ".
@"
{
““short_description””:““Sel - Printer””,
““description””:““Hi Team,
Please check the “”,
““assignment_group””:”“NA””,
““watch_list””:““arpit.sharma””,
““caller_id””:““RPA Bot””
}"
You want me to try and pass in assign -
Description = "Hi Team, \n Please check the "
postwick
(Paul)
August 31, 2023, 2:07pm
7
You don’t put the +VbCrLf+ inside the string.
"Hi Team, " + VbCrLf + "Please check the "
postwick
(Paul)
August 31, 2023, 2:08pm
8
You don’t put the +VbCrLf+ inside the string it’s a constant variable.
"Hi Team, " + VbCrLf + "Please check the..."
Again, though, \n should work but you have to escape the \
:
"Hi Team,\\nPlease check..."
postwick
(Paul)
August 31, 2023, 2:36pm
10
Don’t use the VbCrLf and the \\n
at the same time. Use just the \\n
inside the string.
{"short_description":"Sel - Printer",
"description":"Hi Team,\\nPlease check the ",
"assignment_group":"NA",
"watch_list":"arpit.sharma",
"caller_id":"RPA Bot"
}
I haven’t used VbCrLf and \\n
at the same time time…
Rahul_S
(Robot_L)
September 1, 2023, 9:46am
12
Hi @arpitsharma1.sharma
Try with <br><br>
I am using this with ServiceNow UiPath activities and it works.
Thanks Rahul, that worked…
I had one more requirement that is after new line I need to add data table too in description of SNOW ticket. Can you help me that ?
system
(system)
Closed
September 8, 2023, 7:11am
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.