Conditional Logic in Forms
I am trying to use logic in my form, for example I know that I can do
'if field fruit is apple then show field grocery'
however I was wondering if there was a way to do
"If fruit is any of apple or orange AND dessert is cookie THEN show the following fields: grocery"
, so that two different fields (columns) could be used in the if part of the condition.
Best Answer

If "Fruit" is the column name, then you can search for the value Fruit@row in the text string of known fruits, "apple banana kiwi orange". Finding that the value of Fruit@row is in the text stringthat is to saythe search returns something other than zero, AND finding that a search for Dessert@row in "cake cookie jello pie" returns something other than zero, the formula returns "Grocery". It otherwise returns "Not Grocery."
The expression to search for fruit looks like this...
FIND( Fruit@row, "apple banana kiwi orange")
The expression to search for dessert looks like this...
FIND( Dessert@row, "cake cookie jello pie")
You require BOTH to be true so use the function AND(), that is...
AND(
FIND(Fruit@row, "apple banana kiwi orange") <> 0 , FIND(Dessert@row, "cake cookie jello pie") <> 0 )The general structure of the formula looks like this...
IF( AND( FIND(fruit) <> 0 , FIND(dessert) <> 0 ), "Grocery", "Not Grocery" )
Plug in the details and your formula ends up as...
IF(
AND( FIND(Fruit@row, "apple banana kiwi orange") <> 0, FIND(Dessert@row, "cake cookie jello pie") <> 0 ), "Grocery", "Not Grocery" )There are other approaches as well...
Answers

If "Fruit" is the column name, then you can search for the value Fruit@row in the text string of known fruits, "apple banana kiwi orange". Finding that the value of Fruit@row is in the text stringthat is to saythe search returns something other than zero, AND finding that a search for Dessert@row in "cake cookie jello pie" returns something other than zero, the formula returns "Grocery". It otherwise returns "Not Grocery."
The expression to search for fruit looks like this...
FIND( Fruit@row, "apple banana kiwi orange")
The expression to search for dessert looks like this...
FIND( Dessert@row, "cake cookie jello pie")
You require BOTH to be true so use the function AND(), that is...
AND(
FIND(Fruit@row, "apple banana kiwi orange") <> 0 , FIND(Dessert@row, "cake cookie jello pie") <> 0 )The general structure of the formula looks like this...
IF( AND( FIND(fruit) <> 0 , FIND(dessert) <> 0 ), "Grocery", "Not Grocery" )
Plug in the details and your formula ends up as...
IF(
AND( FIND(Fruit@row, "apple banana kiwi orange") <> 0, FIND(Dessert@row, "cake cookie jello pie") <> 0 ), "Grocery", "Not Grocery" )There are other approaches as well...
Categories
 All Categories
 14 Welcome to the Community
 Smartsheet Customer Resources
 63.8K Get Help
 406 Global Discussions
 218 Industry Talk
 457 Announcements
 4.7K Ideas & Feature Requests
 141 Brandfolder
 136 Just for fun
 57 Community Job Board
 459 Show & Tell
 31 Member Spotlight
 1 SmartStories
 297 Events
 37 Webinars
 7.3K Forum Archives