Created 06-04-2020 04:19 AM
hi everyone ,
We want to put data in web app using API endpoint
https://localhost:8000/api/event/${id}/attributes this is the API endpoint that i have used in invoke HTTP processor in Remote URL field with PUT method.
we want to create new attribute with value and this attribute is a dictionary type so we have to pass the data in the dictionary format for this we have used updateattribute processor and attributetojson processor.
updateAttribute processor snap
Attributetojson processor snap
and the below is out of attributetoJson processor (flowfile)
{"note":"note from nifi","attributes":"{\n \"workflow\":\"process\"\n }","id":"1ecfbcbb-38bf-49e9-a77e-a88w"}
the error msg in invoke http processor
property_name | property_value |
attributes | {"workflow": "process"} |
'attributes' | ${attributes:unescapeJson()} |
Created 06-04-2020 05:29 AM
@renuu You have to build the final values you want as separate key value pairs like this:
Next you will use these attributes to create a json object attribute using AttributesToJson:
After that, if you inspect the flowfile you will see the json object as JSONAttributes:
From here you can use it as ${JSONAttributes} or if you need it to be called ${attributes} you just use another UpdateAttribute:
Created 06-04-2020 05:29 AM
@renuu You have to build the final values you want as separate key value pairs like this:
Next you will use these attributes to create a json object attribute using AttributesToJson:
After that, if you inspect the flowfile you will see the json object as JSONAttributes:
From here you can use it as ${JSONAttributes} or if you need it to be called ${attributes} you just use another UpdateAttribute: