Course Level 2: Discord Error

Describe the problem/error/question

I am trying to complete the course Level 2 but unable to send the message to discord. It keeps telling me that the data formatting is not correct. I have seen a few people who faced the similar issue but resolved by downgrading to 1.82.1 version but I do not have that version available. The current version I have is 1.118.1. If you were able to find any other solution for this, please let me know. Thank you!

What is the error message (if any)?

Please share your workflow

Paste in your workflow JSON here

Make sure not to expose API keys or credentials.

Just pasted them, please let me know if this helps!

This is how workflows usually look like if pasted in using preformatted text section:

@Mookie_Lian I am sorry, I was messing things up. Here is the workflow. Please let me know if there is anything still needs to be changed. Thanks for the help!

I copied and ran the Discord node and it worked. I’m on the same n8n version as you. However, the only difference between my operation and yours was {{ $json.labelIds }}. This expression wasn’t valued in my request and passed as an empty space.

This points out that the issue is in this specific expression. To test it, you can also remove it and try yourself. If it works that way, then I suppose its the issue.

Could you also give an example of what this expression usually values as?

@Mookie_Lian The purpose behind this node is to send the message to discord. The node is receiving the input from Gmail, but the output remains “Your message is incorrectly formatted”. I have tried removing it but fixed version is not working as well.
Labelids, states as sent but the output remain the same. Screenshots attached for your reference.

Try using this HTTP request node that I configured. Replace the Discord node with this one, type your webhook URL and execute workflow.

@Mookie_Lian again same error

Pretty sure it has something to do with the expression being an array(or object) instead of a string. Considering that your input label ID’s have nine items under the same field, it could be that the expression is not pointing out the correct ID properly.

Try using this expression {{ $json.labelIds.first() }}

Because that error is being returned by the webhook, which n8n set. It’s pretty strict on the format since its an automated process and must be robust.

@Mookie_Lian still the same :smiley:

I’m out of ideas :sweat_smile:

ughhh, would be ahuge favor if you could mention someone!