Support Questions
Find answers, ask questions, and share your expertise

Set atribute during all flowfile

Set atribute during all flowfile

New Contributor

Hi , I have a circuit , that I need to execute a POST , and this POST is against a webservice soap, so I send some information and an "ID" parameter , the problem that I get the response I dont have the "ID" parameter , because with that "ID" i have to execute an accion depends on the value of it , how can "save" this ID to use it to match with the http response? I hope have expressed well.

thanks in advance.

5 REPLIES 5

Re: Set atribute during all flowfile

Use Processor GenerateFlowFile at start of flow and include attribute for "ID". Then in any deeper processors access this ID via ${ID}. You can also set attributes using UpdateAttribute Processor in a similar manner. Once attributes are defined they persist through the entire lifecycle of the flow file and are useable in any processor attribute that has "Supports expression language: true" when you hover over the (?).

Please accept the answer if it is helpful for you.

Re: Set atribute during all flowfile

New Contributor

thanks for your answer , the problem is that "ID" is coming from a ExecuteSql Procesor , so -> ExecuteSql -> InvokeHttp-> ExtractText , in InvokeHttp I have to send a soapXML in the body but when I get the response I need to match that response with the "ID" coming from "ExecuteSql.

Thanks in advance.

Re: Set atribute during all flowfile

@Roque M Then you have to extract the value of ID from the ExecuteSql Results into an attribute you can access... concept is still the same just depends on what format the content-file is after ExecuteSQL. In my NiFis i use ExecuteSql (avro output) -> ConvertAvroToJson -> EvaluateJsonPath in EvaluateJsonPath create a new attribute for ID = $.ID

Re: Set atribute during all flowfile

New Contributor

Yeah exactly , but I do the new attribute "ID" in EvaluateJsonPath, I lost all the json content-file , the next processor just get the flowfile with the "ID" content. I need to keep the json content in this case plus the ID attribute.

Re: Set atribute during all flowfile

Set the EvaluteJsonPath Destination to Flowfile-attribute, not content...