Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

147
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda