Skip to main content
April 8, 2023
Solved

Getting data from API - but API parameter is data from a recordType

  • April 8, 2023
  • 20 replies
  • 0 views

Hello:

I need to retrieve data from an external API which requires a parameter (ProductID).  The values for ProductID reside in an application recordType table and has to be passed to the integration.  So, the expression called to populate another recordType to store data from the API has a query.  However, I keep getting this error.  Any suggestions on how to resolve this issue?

Thank you.

Ma

Best answer by stefanhelzle0001

Try to make a step backwards. A service backed record is just using your expression to pass the batch number and get a datasubset returned. This is all your expression has to do. And it does not matter how it is doing it. You can do any number of web service calls to achieve this.

In the record source configuration, you just call your integration passing the batch number as a rule input. Inside that integration object, you call your existing expression to get the list of IDs by passing the batch number.

In the screenshot you write "Need a list of IDs for current batchNumber". What do you mean? Isn'1 that the job of this first expression? Can't you just pass that list of IDs stored in local!ListToProcess into "rule!FST_getFull...something..."?

20 replies

stefanhelzle0001
Brainy
April 9, 2023

Appian has to prevent you from using a query inside the source expression as this could lead to recursive calls and query escalations.

Maybe you go into more details so we have a chance to think about alternative solutions.

man0001Author
April 9, 2023

Here is the pictorial description of what I am trying to accomplish and the error I am getting.  Hope this provides additional details.

stefanhelzle0001
Brainy
April 9, 2023

That's tricky.

When you create your source expression doing two calls does not work. But it should work, when you redesign the integration object to do this.

So that integration just takes the batchNumber, then queries the IDs for that batch and then does a second call to fetch the actual data.