I need to set a text field approver in a form to be a persons email based on another field in the form.
The field is a choice field that it is checking. There are 4 choices so it needs to be If then else if?
I was trying if(datacard11.selected.value = "MSS","person1" then I got stuck since I need = "CMS"then on2" and if "JSS" then "person3" with default at end being "person 4"
Does anyone know the syntax?
I was putting in the default of the text field.
Thank you!!!!!!!!!!!!
Okay, the syntax in your screen shot is different than your first post about it.
You have an equal sign in the one in the screenshot.
The formula should be:
Switch(DataCardValue11.Selected.Value,
"Indianapolis CMS", "Dmclaughlin@parker.com",
"Houston CMS", "Dmclaughlin@parker.com",
"Peoria CMS", "Dmclaughlin@parker.com",
"MSS", "Dmclaughlin@parker.com"
)
In your screenshot, you have an equals after DataCardValue11.Selected.Value.
Also, you might want to use line breaks in your formula to help you spot those issues quicker. (a line break is Shift-Enter)
attached error
Says invalid argument type(text), expecting boolean value instead
I've attached the definitions of the choice field that I'm using to set the text field
Syntax looks good...what is the error you are getting?
I'm in the field called approver, it is a text field and I'm in the default property. The field I'm testing is a different field, it is field order entry which happens to be datacardvalue11. It is a sharepoint choice field and has 'MSS' as a choice.
What is the Items property of that control? If you are trying to set a Default, the default value must match the signature of the Items.
I must have syntax alittle off
You might want to consider the Switch function. Something like this:
Switch(datacard11.Selected.Value,
"MSS", "person1",
"CMS", "person2",
"JSS", "person3",
"person4"
)
That should give you what you need.
I hope this it is helpful for you.
WarrenBelz
106
Most Valuable Professional
MS.Ragavendar
73
stampcoin
52