Hello everyone,
I have a table, and I'm trying to save the result of the user type into a variable called user_type_result. However, my if statement doesn't seem to be working correctly when checking user_type_result.
I've been trying to figure out what’s wrong but haven’t had any luck. Any help would be greatly appreciated!
Thanks in advance.
if(${no_user_type_required} = 'No user type required', 'No user type required',
if(${you_need_the_viewer_usertype} = 'You need the Viewer Usertype', 'You need the Viewer Usertype',
if(${you_need_the_contributor_userty} = 'You need the Contributor Usertype', 'You need the Contributor Usertype',
if(${you_need_the_mobile_worker_user} = 'You need the Mobile Worker Usertype', 'You need the Mobile Worker Usertype',
if(${you_need_the_creator_usertype} = 'You need the Creator Usertype', 'You need the Creator Usertype',
if(${you_need_the_professional_usert} = 'You need the Professional Usertype', 'You need the Professional Usertype',
if(${you_need_the_professional_plus} = 'You need the Professional Plus Usertype', 'You need the Professional Plus Usertype',
'')))))))
text | no_user_type_required | No user type required |
text | you_need_the_viewer_usertype | You need the Viewer Usertype |
text | you_need_the_contributor_userty | You need the Contributor Usertype |
text | you_need_the_mobile_worker_user | You need the Mobile Worker Usertype |
text | you_need_the_creator_usertype | You need the Creator Usertype |
text | you_need_the_professional_usert | You need the Professional Usertype |
text | you_need_the_professional_plus | You need the Professional Plus Usertype |
text | user_type_result | user type result |
Solved! Go to Solution.
You have a complicated relevant calcs, It might be able to be simplified...but without doing that the easiest would be to set defaults
What exactly is the problem? I created a quick survey with your if statement and it calculated correctly, as long as the text value of your questions match the if statement, then it correctly calculated the user_type_result for me.
@RyanUthoff Thanks for reply but I tried with my form and not working. I attached my xls form here maybe I have relevant for some fields
Unless there are some calculations or default answers we are not seeing here, how are you ensuring the user inputs the exact answer the if statements are looking for? Text questions are a open ended and except any input. So an extra space or misspelling will break your statement.
Have you considered a select_one for some of those questions to force the answers you expect in your if statements.
It might be beneficial to see how your asking these questions in the form, to provide a better answer, can you share this portion of your xlsx or at a screen shot of how the questions appear in your form?
So after reviewing your xlsx, you are not calculating an answer for any of your questions. You have the label and the hint as your "answer". You need to calculate (or set as default) the answers you are expecting for your result calculation to work.
@Neal_t_k Thanks for respond. yeah I notice that the problem is that. I don't know how to do it. lol.
I created another field user_type_result which has if statement on it but I can't get answer to this field and save it.
@Neal_t_k Thank you so much your solution is working.
Glad that is working, just a heads up, you have some of your relevant calcs that don't provide a user type or meet the requirements for a more advance license but give a lesser license, for example You may want to get rid of the count-selected here:
You already are require 5 specific answers, but if you answer those 5 and plus another one, you get either nothing or just "Professional". If those 5 are checked no matter what you should get "Plus".
Also something is overriding the "Plus" with the first answer.
I guess just make sure you relevant calcs give you what you are expecting.