ExtractVariables policy usage

Target Endpoint:

<URL>https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemographicDetails_AllColleagues?</URL>

If I pass below URL directly in IE it works

https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemo...

However when i create Extract variable policy as below it gives invalid URL error

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-MV-Employee_ID">

<DisplayName>EV-Employee_ID</DisplayName>

<URIPath>

<Pattern>/org/{Organizations_by_Type!Organization_Reference_ID=BU_MCO}</Pattern>

</URIPath>

<QueryParam name="Employee_ID">

<Pattern>Employee_ID-{Employee_ID}</Pattern>

</QueryParam>

<Source clearPayload="false">request</Source> </ExtractVariables>

Apigee URL giving error is as below

https://praviningawale-eval-test.apigee.net/v1/workerdetails/org/Organizations_by_Type!Organization_...

Solved Solved
0 3 166
1 ACCEPTED SOLUTION

Not applicable

You need to first extract the "Organizations_by_Type!Organization_Reference_ID=BU_MCO?Employee_ID=123456" part from the api url using extract variable policy

https://praviningawale-eval-test.apigee.net/v1/workerdetails/org/Organizations_by_Type!Organization_...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-MV-Employee_ID">

<DisplayName>EV-Employee_ID</DisplayName>

<URIPath>

<Pattern>/org/{Organizations_by_Type}</Pattern>

</URIPath>

<Source clearPayload="false">request</Source> </ExtractVariables>

In a javascript or assign message set the target.url

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
    <DisplayName>Assign Message-1</DisplayName>
    <Properties/>
    
    <AssignVariable>
        <Name>target.url</Name>
        <Template>https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemographicDetails_AllColleagues?{Organizations_by_Type}</Template>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage><br>

https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemo...

The variable I have taken is Organizations_by_Type, you can use any other name.

View solution in original post

3 REPLIES 3

Not applicable

You need to first extract the "Organizations_by_Type!Organization_Reference_ID=BU_MCO?Employee_ID=123456" part from the api url using extract variable policy

https://praviningawale-eval-test.apigee.net/v1/workerdetails/org/Organizations_by_Type!Organization_...

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-MV-Employee_ID">

<DisplayName>EV-Employee_ID</DisplayName>

<URIPath>

<Pattern>/org/{Organizations_by_Type}</Pattern>

</URIPath>

<Source clearPayload="false">request</Source> </ExtractVariables>

In a javascript or assign message set the target.url

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
    <DisplayName>Assign Message-1</DisplayName>
    <Properties/>
    
    <AssignVariable>
        <Name>target.url</Name>
        <Template>https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemographicDetails_AllColleagues?{Organizations_by_Type}</Template>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage><br>

https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT999_MMCWorkerDemo...

The variable I have taken is Organizations_by_Type, you can use any other name.

Below is the steps which I have configured, but this is not working. Am I missing something ?

----------------------------
Assign Message-1
----------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
    <DisplayName>Assign Message-1</DisplayName>
    <Properties/>
    <AssignVariable>
        <Name>target.url</Name>
        <Template>https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT546_MMCWorkerDemographicDetails_AllColleagues?{Organizations_by_Type}</Template>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

--------------------------------
Extract Variable Policy
--------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ExtractVariables async="false" continueOnError="false" enabled="true" name="EV-MV-Employee_ID">
    <DisplayName>EV-Employee_ID</DisplayName>
    <URIPath>
        <Pattern>/org/{Organizations_by_Type}</Pattern>
    </URIPath>
    <QueryParam name="Employee_ID">
        <Pattern>Employee_ID-{Employee_ID}</Pattern>
    </QueryParam>
    <Source clearPayload="false">request</Source>
</ExtractVariables>


-------------------------
Target End Point
-------------------------

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="default">
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <Flows/>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
    <HTTPTargetConnection>
        <URL>https://wd2-impl-services1.workday.com/ccx/service/customreport2/XXX9/999999/CR_INT546_MMCWorkerDemographicDetails_AllColleagues</URL>
    </HTTPTargetConnection>
</TargetEndpoint>


As per the requirement, it works. With change in requirement, little modification will work.