Why the Microsoft SQL node doesn't pass output for all input items?

Here I get all the updated fields, like “Status”, “Name” etc
then Create system notification for each. After that I want to send email notification and for that first I should get the template for each, but if the template is not exist yet, I would like to send a notification to support team for missing template
otherwise get the template and replace the placeholders and send email.

But now the Get template only passed the found templates,

Like it gets 3 input, for two of them has template and for one of them can’t find template, then it only returns those two template and for the missing one I can’t send a notification to the Admin.

Also, in the missing Email Node, I don’t have access to the incoming item which doesn’t have a template.

How can I resolve this? I really apprecait your help.

Hey @Nematullah_Hussaini

Indeed, if you request a DB on a condition that returns nothing (for example an id that doesn’t exist in the table), there’s no item returned.
It’s useful in lots of cases, but not in yours it seems.

That said, you can find workarounds:

  • Try to add a hard code value for each item: SELECT ‘This is a hard-coded string’
  • Use a merge node merging by position the input and the output and don’t forget to check “Include Any unpaired item”
  • Loop over your items with the node “loop over items” and check “Always Output Data” in the microsoft query node settings
  • Proabably other ways…

Try them out and find the one that fits your usecase :slight_smile:

1 Like