String Operations in Assign Message Policy

Dear all,

My target api needs an id (a unique string) to be sent in the request, I don't want the consumer to generate and send it in the payload. We decided to use the messageid in apigee, unfortunately, my target does not accept more than 35 character as identifier, Is there any way to trim the string directly in the assign message policy. Currently I am using a Java script to trim the message id to 35 character and it suffices my requirement, but wanted to know if there is a smarter way without using JS just for trimming.

Thanks

Sanoop

0 4 1,272
4 REPLIES 4

You can create a uuid within a message template. (AssignMessage)

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

Also there are substring operations to trim strings to a particular length.

Could we use split function assign message policy's template? as per the documentation it is not there.

Yours is a New question! Please use the "Ask a Question" button when asking a new question.

Thanks.

done.