2

I am trying to write a simple if statement. I want to check in what community the current user is. I wrote this:

<p>{! IF( {! $Network.Name }==partners,
 'Yep', 'Nope') }</p>

But I am getting syntax errors the whole time.

How do I correct this?

2
  • What is "VFP"? Just VF, Visualforce? Aug 28, 2017 at 21:00
  • @Ant -check answer reminder (if any of the below answers helped resolve your question)
    – glls
    Sep 8, 2017 at 14:59

2 Answers 2

8

Don't use redundant merge syntax. Once you are within the merge, no further curly braces ({}) are required.

{!IF({!condition}, truthy_value, falsy_value}
<!-- ^^         ^ these are your problem  -->

Instead:

{!IF(condition, truthy_value, falsy_value)}
0
2

Below is the correct syntax

{! IF( $Network.Name=='partners', 'Yep', 'Nope') }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.