Unable to update String Variable(Email Body as value) in Service now Update task activity --> Facing error as ({"error\":{"message":"Exception while reading request","detail":"The payload is not valid JSON."},"status":"failure"})

Hi Team,

  1. I am trying to update work notes using Update task in Service Now API like below but it is not working

Error from the server is below

{"error":{“message”:“Exception while reading request”,“detail”:“The payload is not valid JSON.”},“status”:“failure”}


2) I got string value from email body and want update in work notes

String value from email body : ( Hi All,
RITM Work Notes Email Body Test
Thanks,RPA BOT.Note: This message was automatically generated. Please do not reply; the mailbox is not monitored.)

  1. I am getting below when I try to print the value using log message

  1. I was able to update task when I use direct value which got printed using log message Instead of variable like below

— >Error (String response from server)

Can someone please help me that I update email entire body in work notes using variable without any issue ?

Thanks,
Naresh

@ppr

keep in mind, that sometimes an output is beautifying / escaping the Linebreaks (\r\n)

do some experiments by using

  • Environment.NewLine instead of \r\n
  • using Serialized Strings as JSON Value

@v7f5hekr5 …I didn’t get you

@Mandava_Naresh

looks like it is a similar ask…please try this apporach

cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.