Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

how to pass LIST in invoked http post request

avatar
Contributor

 

 

renuu_0-1590424230192.png

 

     updateAttribute processor config

 

renuu_1-1590424290980.png

and this is the output of AttributetoJson processor ....i want tags value in the list like ["UNIX01"] 

2 ACCEPTED SOLUTIONS

avatar
Super Guru

@renuu    The solution you are looking for is:

 

${tags:unescapeJson()}

 

 

If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  

 

Thanks,


Steven @ DFHZ

View solution in original post

avatar
Super Guru

@renuu  Create your attributes how you need them to be in UpdateAttribute.

 

Next use attributesToJson to combine the attributes you want, and put them together into a single json object. In this processor set to flowfile-attribute if you need to use them as attributes later.   If you need to POST the json, use flowfile-content.

 

Once you have set your attributes in UpdateAttribute, test the flow and view the attributes, or the flowfile content.  You may notice the strings are escaped.  If they are escaped, and you need them to not be escaped, that is when you must use unescapeJson.  You can use unescapeJson anywhere you are allowed to use expression language. You could use it in another UpdateAttribute process to make a new attribute that is unescaped.  You can use it in replaceText if you want to unescape the content of the flowfile before posting.     

View solution in original post

4 REPLIES 4

avatar
Super Guru

@renuu    The solution you are looking for is:

 

${tags:unescapeJson()}

 

 

If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.  

 

Thanks,


Steven @ DFHZ

avatar
Contributor

@stevenmatison thnax for reply ...but i have question ..at which processor we have to write this expression ...i have apply this below expression on updateAttribute processor ..but still i am not getting out 

${tags:unescapeJson()}

 please provide me the complete scenario..i meant where i have to write the tag property with value["unix02"] and this above expression .......

thanx in advance  

avatar
Contributor

hi @stevenmatison ,

 this tag is not working ...and we also want to send dictionary {"flow":"process"} in same processor ...

is it possible???

 

 

avatar
Super Guru

@renuu  Create your attributes how you need them to be in UpdateAttribute.

 

Next use attributesToJson to combine the attributes you want, and put them together into a single json object. In this processor set to flowfile-attribute if you need to use them as attributes later.   If you need to POST the json, use flowfile-content.

 

Once you have set your attributes in UpdateAttribute, test the flow and view the attributes, or the flowfile content.  You may notice the strings are escaped.  If they are escaped, and you need them to not be escaped, that is when you must use unescapeJson.  You can use unescapeJson anywhere you are allowed to use expression language. You could use it in another UpdateAttribute process to make a new attribute that is unescaped.  You can use it in replaceText if you want to unescape the content of the flowfile before posting.