You are viewing limited content. For full access, please sign in.

Question

Question

How to get a field to show up depending on which employee is using the Form after a specific action has been taken?

asked on September 20, 2022

I have a Form that I would like to have a field, True Vendor Name, show up when User1 or User2 is using the Form AND after they have selected the Credit radio button from Payment Type but to be hidden if any other user is using the form.

I know that I can have a Field Rule for Field1 like

Show Field1

When all are selected

Payment Type = Credit

Initiator is User1

Initiator is User2

But the issue with this is that the form would never work since both users would never use it in the same instance, but Any doesn't work either.

Is there maybe an IF statement that can house two IF options, =IF(Initiator=(User1 OR User2), True, False))

Or possibly some other option I am not noticing? 

0 0

Answer

SELECTED ANSWER
replied on September 20, 2022 Show version history

Laserfiche support both IF and AND with formulas

Syntax would look like this

=IF(OR(Initiator=User1,Initiator=User2),TrueValue,FalseValue)

=IF(AND(Initiator=User1,Initiator=User2),TrueValue,FalseValue)

 

To get the Current User of the Form takes a little more work.

This post will show you how it can be done to capture the current step on a form. Use the same technique but just with the CurrentUser variable instead of the Step.

https://answers.laserfiche.com/questions/113428/Accessing-the-Name-of-Task-Step#164170

 

The way I might approach this is to create a Hidden field in the form which has those users name

Field: ShowUsers

FieldValues: MaryJaneDoe,JohnSmith, etc     (using their username)

Field:ShowForm

Then use a Formula with FIND to see if the Current User name you captured above is in this list and if the CreditType is Credit.

=IF(AND(PaymentType="CREDIT",FIND(Current UserValue,ShowUservariable,1)>0),"Yes","No")

The way FIND works is if it found an exact match anywhere in the ShowUser field it returns the position of where the first character was in the string. If it found a match then the position will be greater than 0, if not found it return nothing

You can then use this Field Value in your field rules to display what you want

The reason I do it this way is as the users change I can just update the ShowUsers Field without having to change any Rules or the Formulas themselves

Might look a little complicated to set up but will pay dividends down the road.

2 0
replied on September 20, 2022

Brillant! On my way back to work after lunch it dawned on me that I could maybe use some kind of list or array just hadn't gotten around to that yet. This is awesome, thanks for the help!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.