Hello Andrew,
Please find the script for same:
DataSourceName.getDataAsString("MeasureName", {}); - This will return data as string and you can set it directly into textbox.
Replace Data source name and Measure name to whatever is in your case and it will work.
Thanks,
Anand