This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Remove python unicode "u:" from string in YAQL

Hello. I’m in a stackstorm workflow trying to construct a dict object and pass it as a string to core.http.
Above action runs, but fails as the body has the ‘u’ for unicode embedded in front of all the values ( u\‘reason\’: u\‘reasoncode\’ …).

write_elastic:
  action: core.http
  input:
    url: "http://url:port/index/_doc/"
    method: POST
    body: '<% str( { "run_id"=> $.run_id, "results"=> $.results }) %>'
    headers:
      Content-Type: "application/json

How do I produce a string that does NOT have Python unicode encoding for the body?

Try something like the tojson filter

Thanks! That did it!

1 Like

how to use tojson filter? would you please give an example?