Solved

Hide control formula in Forms rule

  • 18 November 2018
  • 5 replies
  • 55 views

Badge +2

How can I hide a control based on the below condition ?

Status Of Request =! 'With HR' or Status Of Request =! 'With Marketing'

In other words, hide the control if Status of Request contains the value 'With HR' or contains the value 'With Marketing'

 

I have found a solution that works correctly using: and(StatusOfRequest=! 'With HR', StatusOfRequest=! 'With Marketing')

 

Why does a formula like this: =(StatusOfRequest =!"With HR' || StatusOfRequest =! 'With Marketing)  not work ??? (I have tried all types of brackets and did not get the desired result

 

What do you think about the formula example below:

If(Identity Validated !='Identity validated',False,Status Of Request Package!='With HR - building the package')

In other Words, hiding the control when Identity Validated is not equal to 'Indentity validated' or StatusOfRequestPackage is not equal to 'With HR - building the package'

Is this a recommended way of hiding the control?

hide rule‌

icon

Best answer by powersj1 21 November 2018, 00:53

View original

5 replies

Hi I am stuck with similar issue. to my understanding so far rules done get applied until you click save button. Infopath had much dynamic rules which trigger instantly. i suggestion is try java script.

Badge +2

It's possible to use the Formula Editor but you need to find the proper logic in using it.

Ok on an side note. Can you tell me how we can cancel a form submission in JavaScript? And let the use complete the form?

Badge +5

=(StatusOfRequest =!"With HR' || StatusOfRequest =! 'With Marketing)

The quotations don't balance and you are using a blend of single and double quotes. Also, || is an or operator, while you've used an and operator in the working example. The or is going to result in it always being true and always hiding.

I would suggest using the runtime functions.

=and(not(startsWith("With HR", StatusOfRequest)), not(startsWith("With Marketing", StatusOfRequest)))

Badge +2

Thanks Jeremiah, your are right, precise formulation Is required.

I think it should be vey nice a set of business cases and formula's that work, because it took me a long time to get to a level which works.

Reply