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.

Apache Nifi: how to set the content of a flow file as an attribute
331 views Asked by Suyash Dhondkar At
1

You could make use of the
EvaluateJsonPathprocessor 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
EvaluateJsonPathto pull the length value as an AttributeThe 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
KEYwith the value as$andReturn TypeasJSON