"A text field contains invalid data. Please check the value and try again." Error in SharePoint Designer Workflow

Error:
 
A text field contains invalid data. Please check the value and try again.
 
 
I was facing this issue when I used “Log to History List” action in my SPD workflow. I was trying to log the dictionary variable value returned from HTTP Web Service and I was getting this error. This issue occurs when you try to log data which is having more than 255 characters. To overcome this issue avoid logging data which is having more than 255 characters.