I'm an absolute beginner coder and trying to learn some of the basics with smaller projects.
Lately I've been trying to load the content of a Microsoft to list on my web site.
I've managed to pull the content with the help of pipedream and Microsoft graph but I'm failing to integrate the pipedream workflow into my JavaScript file.


Every time I get this console error:
SyntaxError:
Unexpected token '<', "<p><b>Succ"... is not valid JSON
I guess the response I receive from the API isn't a JSON file?
How could I resolve that?
leemann
That's cool that you are using Pipedream
I'm confident to know what's the issue here.
See, the error your are experiencing is very much likely because your workflow isn't configured to return a custom HTTP response.
The default response of a workflow ressembles this text:
This certainly isn't data in JSON format.
In order for your workflow to return JSON, you need to do two things in this workflow.
$.responddirectiveIn your case, you'd need to set the axios response to a variable, such as in:
And return the body with the response using
$.respond:For more information, take a look at the documentation, Using custom code with $.respond().
Good luck on your Pipedream endeavours!