Can I assign a integer value to a string?


I’m doing a survey asking users to rate features on a scale of 1 - 5 using the single select data type. However, the responses are strings like Very happy, Happy, Neutral, Unhappy, and Very Unhappy. I need those values to correspond to numerical values like “Very happy = 5”.


Add a new {Rate Value} formula field using the following formula (assuming your rate field is {Rate}):

SWITCH({Rate}, "Very Happy", 5, "Happy", 4, "Neutral", 3,
"Unhappy", 2, "Very Unhappy", 1)