Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to do Null check condition before setting up a header in assign message policy ?

Not applicable

I am setting up a new header from the "Assign Message" policy using a variable.

I want to have some conditional flow (to do Null check) before setting up the header.

For Eg:

If (accesstoken.user-foo != null) {

<Set>

<Headers>

<Header name="FEContext">{accesstoken.user-FEContext}</Header>

</Headers>

</Set>

}

How can I do this ?

Solved Solved
1 2 2,836
1 ACCEPTED SOLUTION

@nishah,

You can't set headers or variables under a specific condition within AssignMessage policy. But you can achieve this in one of the following ways:

  1. Execute AssignMessage Policy only if a specific condition is met (using Condition Flow Variable). In the AssignMessage policy, you can set the header in the usual way. OR
  2. Set the header in a Javascript code using the if block

Regards,

Amar

View solution in original post

2 REPLIES 2