Solved

INFOPATH + Formula with If Statements

Posted on 2013-06-26
1
4,255 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
1 Comment
 
LVL 28

Accepted Solution

by:
clayfox earned 500 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Work Over Net is a new and very powerful collaboration product. With its new easy interface it is becoming very competitive to other similar products like webex and office interactive. WON 2010 have the standard business tools needed for multi-offic…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now