We have a custom function that copies data from our customers in Books to Sheets. In the process the customers' phone numbers (unless they contain a space) get treated as numeric values, so leading zeros get stripped off, and in some cases scientific notation is used.
How can we force Sheets to treat them as text? I've tried formatting the relevant column in the destination sheet as text before the export, but that doesn't seem to have any effect. If I export the same records to an Excel sheet, they stay as text.
Here's part of the function:
Name = Var1.get("contact_name");
customFields = Var1.get("custom_field_hash");
Category = customFields.get("cf_category");
email = Var1.get("email");
mobile = Var1.get("mobile");
phone = Var1.get("phone");
Address = customFields.get("cf_address");
Town = customFields.get("cf_city");
Country = customFields.get("cf_country");
PostCode = customFields.get("cf_postcode");
County = customFields.get("cf_county");
MembershipList = customFields.get("cf_membership_list");
rowData = Map();
rowData.put("Name",Name);
rowData.put("Email",email);
rowData.put("Phone",phone.toString());
rowData.put("Mobile",mobile.toString());
rowData.put("Address",Address);
rowData.put("Town",Town);
rowData.put("County",County);
rowData.put("Postcode",PostCode);
rowData.put("Country",Country);
rowData.put("Membership_list",MembershipList);
Any suggestions?
Thanks