Solved

INFOPATH + Formula with If Statements

Posted on 2013-06-26
1
5,331 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

The Scenario: Let’s say you have a quote worksheet in Excel that you use to work up sales figures and such for your clients. You utilize SharePoint to manage and keep track of these documents. You would like values from your worksheet to populate Sh…
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

707 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