Convert value from script to astring for saving in DB