Silentkiller Respected Contributor.
Respected Contributor.
632 views

Filtering a value from response and passing as input

Jump to solution

Hi Experts,

 

I am new to OO

.I have a scenario where I need to run a webservice which returns authentication code.Now using the authentication code as input,I need to run another webservice.

I used HTTP POST operation in flow and able to succesfully run both services independently.

However when I instruct webservice 2 to take input form previous step it takes whole response from webservice 1.

I need to filter webservice 1 response in such a way that it returns only authentication code

Now only this authentication code should be passed to another webservice as input.

.I used regex to filter out digits in webservice 1 output field but when passing to webservice 2 it still passes whole response.

Could you please suggest what should be right approach to achieve above case.

Also how can I filter a specific value from webservice response and pass only that value to another webservice as input

 

Tags (3)
0 Likes
1 Solution

Accepted Solutions
seppler Respected Contributor.
Respected Contributor.

Re: Filtering a value from response and passing as input

Jump to solution

Here are the screenshots.  While creating these, it occured to me that, for instances like this, you might want to call your variable within a set of hard-coded items such as a JSON format with the variable as the 'value' for a 'key'.  I have covered both scenarios in my screenshot.  Not that the quotes ( " ) are there as part of the JSON formatting and all that's needed to call the variable are the dollar sign and curly braces (i.e. ${varName} ).  Also, for the "Assign From Variable" field, you will see a list of all known variables there so, in this example for instance, you would see an 'authToken' variable in the list.

 

output.pngSetting the Outputinput.pngSetting the Input

-Scott Eppler · Cloud Engineer · Coda Global
3 Replies
seppler Respected Contributor.
Respected Contributor.

Re: Filtering a value from response and passing as input

Jump to solution

You'll need to assign that filtered result to an output (e.g. 'authToken') and then use the "Assign From" field in the next step to specify that variable (e.g. Assign From: authToken)

I'll get you a couple screenshots and post them shortly.

-Scott Eppler · Cloud Engineer · Coda Global
0 Likes
seppler Respected Contributor.
Respected Contributor.

Re: Filtering a value from response and passing as input

Jump to solution

Here are the screenshots.  While creating these, it occured to me that, for instances like this, you might want to call your variable within a set of hard-coded items such as a JSON format with the variable as the 'value' for a 'key'.  I have covered both scenarios in my screenshot.  Not that the quotes ( " ) are there as part of the JSON formatting and all that's needed to call the variable are the dollar sign and curly braces (i.e. ${varName} ).  Also, for the "Assign From Variable" field, you will see a list of all known variables there so, in this example for instance, you would see an 'authToken' variable in the list.

 

output.pngSetting the Outputinput.pngSetting the Input

-Scott Eppler · Cloud Engineer · Coda Global
Silentkiller Respected Contributor.
Respected Contributor.

Re: Filtering a value from response and passing as input

Jump to solution

Thanks Seppler.

It worked perfectly

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.