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

How to split a variable value into 2 new variables in Apigee Proxy Assign Policy

Hello,

I have a requirement where I have a variable called kvmextractedvalue which contains value like 121342:yshasj323. I have to create 2 new variables where 1st variable will contain value of kvmextractedvalue(value before colon) and 2nd variable will contain value after colon from kvmextractedvalue variable. How can I achieve this using assign policy or any other policy in APigee Proxy? Kindly suggest. 
I tried this but did not work:

<AssignVariable>
<Name>clientId</Name>
<Value ref="kvmextractedvalue">
<Pattern>^(.*?):(.*?)$</Pattern>
<Group>1</Group>
</Value>
</AssignVariable>
<AssignVariable>
<Name>secret</Name>
<Value ref="kvmextractedvalue">
<Pattern>^(.*?):(.*?)$</Pattern>
<Group>2</Group>
</Value>
</AssignVariable>

2 3 341
3 REPLIES 3