Show/Hide Field Formula not working in SharePoint List

Copper Contributor

I have the following fields set as below in a SharePoint/MS List:

Programme: Adult

LeaveType: Temporary

 

and the following formula is used to hide a particular field: Returned:

 

=if([$Programme] == 'Midwifery' && [$LeaveType] == 'Permanent' || [$LeaveType] == 'Required to Withdraw' || [$LeaveType] == 'Presumed Withdrawn' , true, false)

Given that neither of the two fields make this formula true, the Returned field should be hidden, yet it isn't.

Can anyone point out why?

Edit@ Just to add I could have sworn it was working originally but it seems to have stopped doing so. Im not sure if this is user error or some weird bug.

1 Reply

@Barking_Mad Can you try grouping AND (&&) and OR ( || ) conditions properly as per requirements?

 

For example: Show field when Programme is  equal to Midwifery AND LeaveType is either of mentioned 3 values: 

 

=if([$Programme] == 'Midwifery' && ([$LeaveType] == 'Permanent' || [$LeaveType] == 'Required to Withdraw' || [$LeaveType] == 'Presumed Withdrawn'), true, false)

 

Where you Programme and LeaveType the correct internal names of the SharePoint list columns. You can get the internal name of your SharePoint list columns by following this article: How to find the Internal name of columns in SharePoint Online? 

 

Also, make sure to use the if, true and false in small letters only as shown in your formula. Using capital letters in these default keywords might not work sometimes.


Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.