Solved

INFOPATH + Formula with If Statements

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

There is one common problem that all we SharePoint developers share: custom solution deployment. This topic can't be covered fully in this short article, so all I want to do in this one is to review it from a development-to-operations perspectiv…
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…
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, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

17 Experts available now in Live!

Get 1:1 Help Now