Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda