Template Function is not being processed

Not applicable

Hi,

I have created a policy(AssignMessage) which sets a header variable using templateFunction replaceAll. The policy is attached to my TargetEndpoint->PreFlow->Request->Step->Set->Headers->Header.

<Header name="NEW_HEADER">{replaceAll(fooBarVar, "1", "0")}</Header>

The result expected would be:(when foorBarVar is 111)

NEW_HEADER=000

However it's not processing the function. Meaning the NEW_HEADER has the expression as the value:

NEW_HEADER= "{replaceAll(fooBarVar, "1", "0")}"

The APIGee version I am using is 4.17.05.01.

Does anyone have a clue?

Solved Solved
2 7 916
1 ACCEPTED SOLUTION

Yes, I have an answer.

The replaceAll() function, and the other static functions, that can be used in Message Templates.... will first be available in OPDK, in the 19.01 release.

These functions are available for use in Message Templates in Apigee Edge SaaS now.

Also you need to collapse spaces and use single quotes.

<Header name="NEW_HEADER">{replaceAll(fooBarVar,'1','0')}</Header>

View solution in original post

7 REPLIES 7

Nice question, even I am not able to use replaceAll function. I am getting the same fooBarVar value. It is not replacing anything in my case.

Example provided in doc are also not working,

https://docs.apigee.com/api-platform/reference/message-template-intro#replace-all-function

Not applicable

Hi, I also followed the documentation. I've tried other functions(replace and substring), with no success.I also have tried to assign to a temp variable(AssigVariable), but no success.

Yes, I have an answer.

The replaceAll() function, and the other static functions, that can be used in Message Templates.... will first be available in OPDK, in the 19.01 release.

These functions are available for use in Message Templates in Apigee Edge SaaS now.

Also you need to collapse spaces and use single quotes.

<Header name="NEW_HEADER">{replaceAll(fooBarVar,'1','0')}</Header>

we are APIGEE on prem edge 4.50.00 and having issue with replaceAll in Assign Message Template

If you're having a problem, and you want some help, you'll need to describe it.

And when you do that, I suggest that you ask a new question.

10891-ask-a-question.png

Pinging an Apigee developer. @sgilson (sorry).

ping about what? If you have a question, ask a new question. (I saw that you asked a question in a separate thread. I answered there.)