truncate custom value to 300 char and encode value