You are viewing limited content. For full access, please sign in.

Question

Question

And Or Lookup Rules

asked on January 22, 2014

When setting up a look up is there a way when adding multiple "When" clauses if it should do "And" or "Or"?

0 0

Answer

APPROVED ANSWER SELECTED ANSWER
replied on January 22, 2014 Show version history

Within a particular rule, you can add multiple conditions to create AND logic.

 

To create OR logic, you'd want to create multiple rules and order them in the order you want the rules to be evaluated. The list of rules is evaluated from top to bottom, so creating multiple rules should give you a way to create OR logic.

1 0

Replies

replied on January 22, 2014

So what would we do if we want to create AND logic for the same Fill field? So for instance we have a field to display a Teacher. We only want Teachers to display that have a Status of 1 AND a selected School ID.

0 0
replied on January 22, 2014

Where are you getting the value for Status? Currently what you're describing isn't available in simple lookup rules, but should be doable with SQL stored procedure lookup rules. Form fields like School ID and Status could be input parameters for a stored procedure that returns a teacher and list of students in its result set.

0 0
replied on January 22, 2014

The Status is a Form field that has a default value of 1. This field will be hidden because 1=Active in the database. This is using an Oracle database, so stored procedures aren't an option.

0 0
replied on January 22, 2014

As long as the field values are being matched against columns in the table, you should be able to accomplish what you're trying to do, whether by using multiple conditions within one rule or by using multiple rules in a specific order.

0 0
replied on January 22, 2014 Show version history

I thought by adding multiple conditions in one rule made it an OR?

 

It would certainly be nice to be able to tell it whether you wanted it to be OR or AND logic. It would also be nice to be able to add custom queries like in Workflow.

You are not allowed to follow up in this post.

Sign in to reply to this post.