Showing posts with label NDScript. Show all posts
Showing posts with label NDScript. Show all posts
Tracing Function Calls in JavaScript or Node.js or Dialogflow
For debugging our code we often need to track the function call hierarchy. There we need to understand and visualise which function is being called by which function and their sequence of calls. If you search for this in JavaScript then you will either find the deprecated features like Function.caller or not very flexible or useful features like console.trace(). So I found no better way than my custom developed one (as follows) to trace function calls in JavaScript while building my Google Dialogflow Chatbot.
Look for more in:
Dialogflow,
Google Cloud Functions,
JavaScript,
NDScript
Handling Complex Logs better for Google Cloud Functions
If you are looking for a solution to handle and read the complex logs like JSON or object outputs better then this small read may help you. You may be familiar with the following type of weird line by line log display of a JSON or object type error response from your functions or web services.
Look for more in:
Dialogflow,
Google Cloud Functions,
NDScript,
Spreadsheet
Formatting text responses better for Dialogflow Agent
If your bot is responding to the users primarily in the text then there may be a need to format those text messages in the following conditions. This is also applicable for any bot backed by JavaScript/Node.js codes.
- You have the following environmental conditions.
- Node.js or Javascript.
- Visual Studio Code or Similar IDE with auto code/document formatting options.
- You have the text responses in the code itself.
- You need to avoid long lines in the code.
- The long text responses also need to be handled efficiently with the code.
- You use new lines to handle long text responses.
- Your bot responds to the users primarily in text and you want them to make it better.
- You want the big text responses to format in more than one line or paragraph.
Look for more in:
Dialogflow,
Google Cloud Functions,
NDScript
Google Dialogflow fulfillment index.js customization
Here is an example of Google Dialogflow fulfillment index.js which has been customized in various ways. You will get the following ideas out of it.
- What are the mandatory components in index.js?
- How to include codes or call functions in index.js from other files?
- How the index.js file can be kept as small as possible?
- How to manage a complex bot?
- How to handle many intents and their corresponding fulfillment codes or functions?
Look for more in:
Dialogflow,
Google Cloud Functions,
NDScript
Programming Alerts in Google Apps Script
Following codes (JavaScript) show how to write various types of alerts in Google Apps Script (GAS). It also shows the usage of the alias for function in JavaScript.
GAS Function to get the Count of a Specified Item in an 1D Array
A JavaScript function, specially meant for Google Apps Script or GAS, to get the count of a specified item (case sensitive) in an one dimensional (1D) array. It takes the parameters such as "array" which is the one dimensional array on which the search needs to be done. And the other parameters and return value are explained in the function below itself in JSDoc format.
GAS Function to search a value in a Multidimensional Array
A JavaScript function, specially meant for Google Apps Script or GAS, to get the vertical (column-wise) lookup value from a multi-dimensional array. It takes the parameters such as "searchValue" which is the value to search for the lookup. And the other parameters and return value are explained in the function below itself in JSDoc format.
Subscribe to:
Posts (Atom)
B.Ed.
(7)
Blogger
(1)
Cloud Storage
(2)
Community
(9)
Customer Support
(1)
Dialogflow
(4)
Education
(6)
English
(3)
Environment
(1)
ERP
(6)
GAS
(3)
GAS-Alerts
(1)
Good Reads
(1)
Google Business Tools
(8)
Google Cloud Functions
(4)
Health
(2)
Internet Technologies
(1)
JavaScript
(3)
Mathematics
(1)
Mobility
(5)
NDScript
(7)
Others
(8)
Philosophy
(2)
Professional IT Tools
(8)
Psychology
(1)
Self Help
(1)
Sports
(1)
Spreadsheet
(1)
Tathyika
(3)
Tathyika's Dance
(3)