Solved

INFOPATH + Formula with If Statements

Posted on 2013-06-26
1
5,044 Views
Last Modified: 2013-06-27
i have an infopath form with several fields for the user to fill out, and a button that submits the data to a sharepoint list.

when the button is clicked i want to check three of the fields and if any of them have a value of "DUPLICATE" then i set the value of another field as "BAD" and if none of the three fields have the value then the other field would be set to "GOOD"

Is there a way to use an if statement in the formula field so this can be achieved?
0
Comment
Question by:dkilby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
ID: 39277685
You can do any logic you want with InfoPath rules, but the syntax and approach is a little different.
1. For your validation field best practice would be to use a boolean or the false rather than good or bad in a text field.  A little bit simpler and faster.
2. There are two approaches to the check.  Put the check on the submit button as an action.    Create a new rule and add a condition.  Field1 equals Duplicate or field2 equals Duplicate or field3 equals duplicate.  Then have the action be a set a fields value
3. The other way is to put a rule on each of the fields to be checked.  If the field equals one of the other fields or duplicate then set the field value to true.  The advantage here is that you can alert the user to bad input sooner rather than at the end and they have to start over.  It is also easier to have messaging as to the exact field which is the problem since it is in context.

so the answer is to use OR statements and conditions. This is often not trivial and takes experimenting to get the correct logic. Such as if you use not equals you have to flip to and statements.  Always do things in small steps and validate before moving on to the next one.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The vision: A MegaMenu for a SharePoint portal home page The mission: Make it easy to maintain. Allow rich content and sub headers as well as standard links. Factor in frequent changes without involving developers or a lengthy Dev/Test/Prod rel…
Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question