How can I create a content-related condition string?

Not applicable

Hello 🙂

I want to create a condition flow with a content related condition string.

I have a JSON-request, like this:

{
	"root": {
		"InformationForCondition": "condition 1",
		"main": {
			"data": [
				"",
				"",
				""
			]
		}
	}
}

Now I want to use the value of InformationForCondition in my condition string, like following:

(request.root.InformationForCondition= "condition 1")

But how can I do this?

FYI:
I need this condition also in my response condition string.


Thanks!

0 1 238
1 REPLY 1

Hi @David Boden-Pollack, we can use an Extract Variable Policy, to extract out the `InformationForCondition` and then use it as a condition.

<ExtractVariables name="ExtractVariables-3">
   <Source>request</Source>
   <JSONPayload>
      <Variable name="info">
         <JSONPath>$.root.InformationForCondition</JSONPath>
      </Variable>
   </JSONPayload>
   <VariablePrefix>david</VariablePrefix>
</ExtractVariables>
<Condition>(david.info = 'condition1')</Condition>