but this isn’t working, as in I am not able to get any value in the params.
If I were working on this, I would want to break it down into separate parts. The ExtractVariables is one part - you need to maker sure that the ExtractVariables policy in the request flow is working as you expect, setting the variables you expect.
The second thing I notice is that in your JS policy, you are setting a value into TargetPath. This value… then gets set into the path for the outbound request via this snippet.
<HTTPTargetConnection>
<LoadBalancer>
<Server name="URL"/>
</LoadBalancer>
<!-- Path will be set with the value of the TargetPath context variable -->
<Path>{TargetPath}</Path> <!-- added here -->
<path/> <!-- omit this. This element is unnecessary and irrelevant. -->
</HTTPTargetConnection>
And what is the value you are setting into TargetPath? It is a thing with various pairs of curly braces. But there is nothing in Apigee that automatically de-references the contents of variables, forever and ever, until there are no more curly braces. That de-referencing happens exactly once: in the TEXT value of the Path element within the HTTPTargetConnection.
If your TargetPath holds “/foo” then the path shall be “/foo”.
If your TargetPath context variable holds “/a/b/c/{param1}” then Apigee will use as the path, “/a/b/c/{param1}” .
There is no second-pass of indirection.
Therefore I think you can omit the JS step, and simply specify the path in the Path element
<HTTPTargetConnection>
<LoadBalancer>
<Server name="URL"/>
</LoadBalancer>
<!-- Path will be set to the result of evaluating the template -->
<Path>/services/apexrest/vlocity_cmt/v1/integrationprocedure/DEMO_VIP?param1={varPrefix.param1}¶m2={varPrefix.param2}¶m3={varPrefix.param3}</Path>
</HTTPTargetConnection>
And if you need one more param, optionally, then you may be able to get there by using a policy something like I showed earlier
<AssignMessage name='AM-Param4'>
<Set>
<QueryParams>
<QueryParam name='param4'>{whatever-variable-you-have}</QueryParam>
</QueryParams>
</Set>
</AssignMessage>