How do I base64 decode data from my incoming HTTP payload?

Raoul Strachan : hmmm … it’s throwing the Type Error again now … grr

Dylan Sather (Pipedream) : do you see the variable you’re referencing in the base64-decode step? For some reason that reverted to the old value. Try changing that to the correct, payload value

Raoul Strachan : ok … it’s working now but I’m getting gobble-de-gook in sheets …

Raoul Strachan : I’m getting ‘�40=�U�3’ :slightly_smiling_face:

Raoul Strachan : but hey … it’s progress. I’ve got data flowing …

Dylan Sather (Pipedream) : that’s actually the value of the base64-encoded data as returned from that step:

Dylan Sather (Pipedream) : we assume UTF-8 encoding in that step. Is your data using a different encoding?

Raoul Strachan : ah ok … so if I wanted to decode it, could I do that in pipedream too?

Raoul Strachan : yes … base64

Dylan Sather (Pipedream) : are you sure the data is being base64-encoded correctly before you send it?

Raoul Strachan : I thought the ‘steps.base64_decode_string’ step would do that and that Sheets would display the utf8 output. ok looks like i’ll have to revisit the plan :slightly_smiling_face:

Raoul Strachan : no … lI’l check that. It’s coming from a helium console. It’s an IOT sensor.

Dylan Sather (Pipedream) : yeah that step just decodes whatever you pass it. You can confirm the fact that the base64-encoded data might not be encoded correctly by using https://www.base64decode.org/, for example

Raoul Strachan : ah ok thanks … I’ll give that a try.

Raoul Strachan : Thanks so much for your help today :slightly_smiling_face:

Dylan Sather (Pipedream) : of course, reach out anytime!

Raoul Strachan : Thanks … you might regret that lol …

Dylan Sather (Pipedream) : :laughing:

Hi folks!

I have a related problem: I’m sending encoded base64 data from Helium console to National Instruments Systemlinkcloud servers using pipedream. My workflow has three nodes:

  1. step.trigger (get the information from Helium console)

  2. step.base64 (code copied from pipedream online example)
    Code:
    const buffer = Buffer.from(params.data, ‘base64’);
    this.data = buffer.toString(‘utf8’).trim();

  3. step.put (transmits the information to NI Systemlinkcloud servers)
    Payload:
    {
    “value”: {
    “type”: “STRING”,
    “value”: “{{steps.base64.data}}”
    }
    }

The decoded information looks OK

But when I try to pass the decoded data with the variable {{steps.base64.data}}, I got error 400 from NI servers.

If I substitute the variable “{{steps.base64.data}}” for any string like “TEST”, I got a successfully 200 message from NI servers. I will appreciate it if anyone could orient me on what´s missing in my workflow.