Solved

INFOPATH + Formula with If Statements

Posted on 2013-06-26
1
4,644 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
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

SharePoint Designer 2010 has tools and commands to do everything that can be done with web parts in the browser, and then some – except uploading a web part straight into a page that is edited in SPD. So, can it be done? Scenario For a recent pr…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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