0

I'm testing the Assistant feature of using Webhooks and by some reason I don't receive any output. My Cloud-Function code looks so:

async function main(params) {
    switch (params.action){
        case 'bills':
            var resp_final = [
                {
                    value: 'Rechnung RN1074801326',
                    datum: '28.02.2021',
                    total_preis: '710€'
                },
                {
                    value: 'Rechnung RN8243559014',
                    datum: '01.03.2021',
                    total_preis: '130€'
                }
            ];  
            return { elements: resp_final };
            break;
        //DEFAULT RETURN
        default:
            return {no: 'default'};
    }
}

And I invoke it from the assistant like so: enter image description here

As you can see, only [0].value gets printed to the console. Even if I don't specify any attribute there is still no result on the console. However, I tested the Cloud function with parameters and it's working (it shows the array without problems). Any reason why this might occurs?

CodiClone
  • 141
  • 1
  • 2
  • 8
  • 1
    Have you checked the Cloud Function activation record? Is the webhook called? What if you use ` $webhook_result_1 ?>` as responds, just for testing? – data_henrik Mar 06 '21 at 08:58
  • Hey Henrik. I managed it - I just basically need to go deeper in the $webjooh_result_1 variable. But I have a different problem now - I can't instantiate a IamAuthenticator in the Cloud function: ```Cannot find module 'ibm-watson/auth'``` – CodiClone Mar 07 '21 at 02:43
  • that's a different question - check which modules are available per runtime – data_henrik Mar 07 '21 at 10:58
  • I've wrote another post, can you check it, please? https://stackoverflow.com/questions/66515480/ibm-cloud-functions-cant-find-ibm-watson-auth-package – CodiClone Mar 07 '21 at 11:01

0 Answers0