Lookup from Variables in Architect flow

Hi Team,

Need some insights and feasibility check on below solutions.

We are making API call using web service data actions to some 3rd party application to fetch data. Below is the flow sequence for our solution.

1.Customer enter details using DTMF collecting this in a variable then using in data action to further pass it XYZ application
2. XYZ application return some key number in response for the transaction which we will save it in "Flow.Key" variable
3. We make another get call in same to XYZ application to fetch Customer details.
4. XYZ app returns with response like Address and Key number for all users.

Now we need to look up the key received in step 2 from details received in 4 and find out the respective address for key.
So its basically we are looking-up variable (1st API call) from Variables from (2nd API call)

image

Regards,
Ameya

Hello,

From a logic standpoint, there is probably a way to do this using the Data Action and some functions (via Expression Builder) in the Architect flow.

But what troubles me is what you write in Step 4: "response ... for all users."
There is likely a limit in terms of size of a response body in a Web Services Data Action.

Wouldn't you have any API available to query the user details based on the key?

And if not, how many users would be retrieved at once?
What would be the size of such a response/document?
Would that a "paged" request (total, pageNumber - ability to specify a pageNumber in the request)?

Regards,

Hi Jerome,

Please find below are my response.

From a logic standpoint, there is probably a way to do this using the Data Action and some functions (via Expression Builder) in the Architect flow.

But what troubles me is what you write in Step 4: " response ... for all users. "
There is likely a limit in terms of size of a response body in a Web Services Data Action.>>>>> What is the for the size of a response in body of web service ?

Wouldn't you have any API available to query the user details based on the key?>>No we don't have API where we can query the user details

And if not, how many users would be retrieved at once?>>>Max we are considering 10 users to be retrieved at once
What would be the size of such a response/document?>>>Will need to check in real time
Would that a "paged" request (total, pageNumber - ability to specify a pageNumber in the request)?>>>>It won't be at paged response

Hello,

I don't know what is the max size of a body response in a Data Action. I have asked around but it is not precisely known.

Having said that, I raised that concern as I thought you were talking about retrieving hundreds of users at once (several kilobytes of data).
As you mention a max of 10 users in the response, that shouldn't be a problem.

And as this is not a lot of data to manage at Architect flow level either, you could even use the standard rawResult in the Output configuration of your second Data Action.
I mean this:

{
  "translationMap": {},
  "translationMapDefaults": {},
  "successTemplate": "${rawResult}"
}

DataAction will flatten the output automatically for your second query. And in Architect, you will be able to define output variables in the Call Data Action that will hold the list of Keys, a variable for the list of Addresses, and a variable for the list of User Names.
You can then use a Function in Expression Builder (Architect level) to find the Key (from first Data Action) in the list of keys.
You can use FindFirst function on the variable holding the list of Keys. This will give you the index of the searched key in that list.
And then use this index to get the Address and the User Name using the 2 other list variables (using myVar[myIndex] or using GetAt function in Expression Builder).

Let me know if that answers you question.

1 Like

@AmeyaP
Regarding this: "DataAction will flatten the output automatically for your second query".
The Output contract and Output configuration will vary depending on what your second query returns.

I mean if it returns a JSON object, with an attribute for the array of (Key, Address, User Name). Like: { "MyArray": [{"Key": "1234", ...}, {"Key": "456"}])
Or if it returns an array directly, like [{"Key": "1234", ...}, {"Key": "456"}]

Let me know what the format of your 2nd API response is and I can help figuring out a simple output configuration and output contract.

Regards,

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.