How to retain user context after Analyze Image module in n8n flow to send Teams chat message

Hi everyone,

I’m currently building an n8n flow that performs the following steps:

  1. Loop through a list of users (from Microsoft Graph API).
  2. For each user, analyze their profile picture using OpenAI’s “Analyze Image” module.
  3. Then, based on the result (e.g. no image or specific content), I want to send a Teams chat message to the user via Microsoft Graph API (/chats endpoint).

The problem:
When I use the Analyze Image module, the output from previous steps (especially the user’s id or mail) is lost. So when I try to build the request body to send the chat message, I get an error like:

csharp

Sao chépChỉnh sửa

'[email protected]' field is missing in the request.

I tried using a Merge node after Analyze Image to re-attach the user info, but I’m not sure if I’m using it correctly.

What is the best way to keep or merge the user info after calling Analyze Image, so that I can send a proper Teams chat message to that same user?

Any help or example would be appreciated!

Thanks :folded_hands:

Easiest and in my opinion best thing to do, is to merge the data with a merge node.

1 Like

I’m not sure how to perform a merge. Could you please provide a specific example or demo?

It is as easy as it sounds. Just place the merge node and wire it up.
Did u do the courses to learn the basics? The merge node should be covered in there as well.

1 Like

I need to use the Append function to merge elements, but I haven’t had time to fully understand how it works because this task was given to me urgently.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.