Access Variable defined in Shared Flow

Not applicable

Hi all,

First, thanks for your time. My situation is as below:

We would like to develop a "Shared Flow" to call an endpoint and extract some fields from the response. However, we still haven't figure out how to access the "variable defined inside the Shared Flow" from the main API Proxy Flow.

We have tried the following, but seems not working.

- Javascript: context.setVariable('var', 'value');
- AssignMessage with <scope>apiproxy</scope>

Appreciate if you can guide as a direction!

Solved Solved
0 3 644
1 ACCEPTED SOLUTION

Not applicable

Hi @Chiu Ka Wing,

You should be able to access.

Example js in sharedflow and accessing the same in assign message

context.setVariable("shareflow.source", "Iamfromsharedflow");
<?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>name</Name>
        <Value/>
        <Ref>shareflow.source</Ref>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

View solution in original post

3 REPLIES 3

Not applicable

Hi @Chiu Ka Wing,

You should be able to access.

Example js in sharedflow and accessing the same in assign message

context.setVariable("shareflow.source", "Iamfromsharedflow");
<?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>name</Name>
        <Value/>
        <Ref>shareflow.source</Ref>
    </AssignVariable>
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    <AssignTo createNew="false" transport="http" type="request"/>
</AssignMessage>

My bad, i mix up "KeyValueMapOperations" and "AssignMessage"..

Thanks!

Is there any help for this issue plz ? .....It looks like a common issue among apigee users!