Solved

How to set up HTTPCaller to take the contents of a column of AttributeManager and concatenate at the end of the URL for multiple requests?

  • 21 November 2022
  • 6 replies
  • 13 views

Hell everyone,

 

I apoligize if this has been answered already but I haven't had any luck trying to find a solution. Basically I have a URL in HTTPCaller that I need to append a value at the end of so that I can run multiple GETs. The values that I need to append are stored in an AttributeManager column. I understand that I may need to create some type of looping function that will go through the list of attributes, append the first value to the end of the URL in HTTPCaller, run the GET request, save the results, get the next value in AttributeManager, append to the end of the URL, run the request, etc.. but not sure how this could be configured in FME. Ultimately we will need to place the results of all the GET requests in one data set.

icon

Best answer by dustin 21 November 2022, 22:24

View original

6 replies

Userlevel 3
Badge +26

How many features are being processed in your AttributeManager? Just 1 feature with multiple attributes containing the values? Or are there multiple features entering the AttributeManager with a common attribute, but different attribute values?

 

If it's the later, the HTTPCaller will process a request for each feature that enters the transformers, so you could setup your Request URL in the Text Editor, appending the value to the end of your URL like in the screenshot below.image 

 

I am using 1 feature that is containing multiple attributes containing the values.

Userlevel 3
Badge +26

I am using 1 feature that is containing multiple attributes containing the values.

How many attributes do you have to process? Too many to just setup multiple HTTPCallers, one for each attribute?

How many attributes do you have to process? Too many to just setup multiple HTTPCallers, one for each attribute?

Yes plus the number of attributes are dynamic so I won't know how many there are.

Userlevel 1
Badge +21

If you use an AttributeExploder, you will get multiple features, one for each attribute and containing the attribute value. You should then be able to use these features to formulate your http request.

Thank you for all your help. I was able to get this working using AttributeCreator by adding the name of the field at the end of the REST URL (@Value(serialNumber) then for the 2nd HTTPCaller I called the New Attibute name in the Request URL field.

 

AttributeCreator

Reply