Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

143
Views
How to make a webhook in dialogflow fulfillment with 2 conditions

I am trying to combine two conditions in fulfilment.
basically, I want the type of admission and the department condition to be met before my chat bot replies based on the input. problem is in the ADMISSION_ENQUIRY intent code here is the code I tried:

const {dialogflow} = require('actions-on-google')

const WELCOME_INTENT = 'Default Welcome Intent'
const FALLBACK_INTENT = 'Default Fallback Intent'
const ADMISSION_ENQUIRY = 'admission_enquiry_intent'
const DEPARTMENT_ENTITY = "Department"
const ADMISSION = "Admission_Type"

const app = dialogflow()

app.intent(WELCOME_INTENT, (conv) => {
    conv.ask('Hi, this chatbot was created to answer any question you may have about The Federal University of Technology Owerri')
})

app.intent(FALLBACK_INTENT, (conv) => {
    conv.ask("I didn't understand your request")
})
app.intent(ADMISSION_ENQUIRY, (conv) => {
    const department_type = conv.parameters[DEPARTMENT_ENTITY].toLowerCase();
    const admission_type = conv.parameters[ADMISSION].toLowerCase();
    if (department_type == "mathematics" && admission_type == "UTME") {
        conv.ask("MATHEMATICS is a department under the SCHOOL OF PHYSICAL SCIENCES. To get admitted into the department, it is required that you have At least five O’ Level Credit passes in English Language, Mathematics, Chemistry, Physics and any other science subject, in not more than two sittings. At least a Pass Is required in Biology. The JAMB course combination for the department is; English Language, Mathematics, Chemistry and Physics.")
    }
    else if (department_type == "chemistry" && admission_type == "UTME") {
        conv.ask("CHEMISTRY is a department under the SCHOOL OF PHYSICAL SCIENCES. To get admitted into the department, it is required that you have At least five O’ Level Credit passes in English Language, Mathematics, Chemistry, Physics and any other science subject, in not more than two sittings. At least a Pass Is required in Biology. The JAMB course combination for the department is; English Language, Mathematics, Chemistry and Physics.")
    }
    else{
    conv.ask("thank you for asking that but we have not coded the answer yet")
    }
})

exports.dialogflowFirebaseFulfillment = functions.https.onRequest(app)```
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!