I am trying to fetch some data via an api and want to set the result of the api as an attribute of the flow file. I am able to fetch the data via the api but cannot seem to set it as a an attribute.
You could make use of the EvaluateJsonPath
processor to get the desired data from the flowfile into the Attribute.
The below sample flow invokes an API and gets data
The content of the response that is received
Properties set in the EvaluateJsonPath
to pull the length value as an Attribute
The output of the processor sets the Attribute Key with its corresponding value
To set the API response as a whole into the Attribute set the KEY
with the value as $
and Return Type
as JSON