Integration >> Fail option does not return correctly

I’m currently using Integration > GET with Google Sheets. That means every time User input a value that match with item in Sheets, the operation is considered successful. But if the input is not in the Sheets, the operation is considered failed. If it’s failed, a Fail-Speak-block will be triggered. The problem is when it’s failed, the Success-Speak-block is still triggered, with variables = undefined. I don’t know how to fix this. Please help me out. Thank you!

fail option of integration block is for errors like cannot access to google sheets, not for match nothing.

so you should check if variable is undefined or not using IF block after integration block. also, “undefined” is special meaning in IF block, this does not work.

use expression of IF Block, and condition should be “{variable} == undefined”, then it will work.

  1. remove “=”

  1. click “</>” and choose “expression”

  1. fill in like this

1 Like

Thank you for your answer. Here’s what I mean with the undefined. This is the CORRECT one.

This is the INCORRECT one.

The Company Code HPG is in the db in GSheets. When I ask something that not in the db, they still return the Success-Speak-block, not the Fail-Speak-block, just change all the variables to UNDEFINED.

that’s correct behaviour. as I said,

this means if there’s no recoed to be matched, it will go to success path and values in variable wmapped in integration will be ‘undefined’.

That’s why you need to put IF block after success path of Integration block and check if values are returned correctly or not.

whole flow will be like this, I think.

1 Like

It works like a charm. Thank you so much! :smiling_face_with_three_hearts: :smiling_face_with_three_hearts: :smiling_face_with_three_hearts:

This has worked great for me but it just starting returning error var not found. Was there a change to VF?

BTW, this is fixed now.