Read an excel file in fulfillment of DialogFlow - dialogflow-es

Is it possible to upload an excel/json file for a bot and read through it by code written in the fulfillment after an intent is matched.
example, I have a dictionary in excel format, I want to take user input and for that word return the meaning. All the words are stored in an excel along with their meanings. Can this be done by writing js code in fulfillment to read excel (which might be stored somewhere)
or we need to go by creating a webhook for a DB as shown here https://medium.com/#pallavtrivedi03/how-to-make-a-webhook-for-dialogflow-fulfillment-d02835cc50bf ?

Your fulfillment webhook code can do (mostly) anything that you can do in code, as long as you do it quickly enough.
If you have a library that can read the excel format, then you should be able to use it in your fulfillment.
The article you reference just happens to do that with a database, but you can use anything as long as you have (or can write) a library.

Related

Need to read the excel attached in BMC Remedy incident via REST API

I need to read the excel attached within an incident in BMC Remedy. I am already connecting to Remedy via REST and can read the attachment but the thing is that it gets converted to String so only text based files like .txt, .log or .csv could be read but if at all the excel is attached obviously since it is not text based all I receive is gibberish.
So I am looking for a REST call that can read the excel and if cannot(which is quite possible) I am looking for a REST call with which I can download the excel locally.
Or if anyone has any other suggestion that would be really helpful

Extract Keywords from Office Documents with Sharepoint Flow

I am trying to implement a document management system using Sharepoint. One major issue is that colleagues cannot find documents in the current setup (local fileserver). They have asked that we have a system that scans uploaded documents and automatically looks for keywords in them and then populates a "Meta" column.
I have had sort of success with OCR on image files, but getting keywords out of office documents (doc, xls etc.) I have had no success until now.
Is there a way to setup a flow to do this task for me?
any help is much aprechiated.
i tried "Get file metadata" and Azure "Text analysis", but it seems to take the raw data of the files (XML I assume) and returns that the document is to large to analyse.
There is something vague about this requirement - how is a keyword defined in a document?
Therefore, first obvious solution would be to assign keywords for each file upon uploading it. You may create a process for this with flow - have tasks, reminders and so on.
Automating this with OCR first means that you need to user OCR that works with MS flow you have only one choice - ElasticOCR. Then, in your flow
- feed the document content to the ElasticOCR action
- keep in mind that OCR is not 100% accurate
- analyze the generated text content according to your keyword definition
- finally write the meta back to the library in the corresponding columns.
Having worked on a similar requirement, we asked uploaders to publish their documents with a short abstract(column from the content type). The assumption is the abstract contains the keywords and is stored in a multi-line column - making it searchable site wide.

Is this response normal in Amazon MWS reports?

Hi. I am trying Amazon MWS for the first time. I have referred to - https://docs.developer.amazonservices.com/en_UK/reports/Reports_Overview.html
I made a call as shown in the diagram on that page. I am using the scratchpad.
Called the Request Report with required fields. In this case ReportType -
"_GET_MERCHANT_LISTINGS_DATA_"
Then I called the GetReportRequestList with the "ReportRequestId"
returned from the previous call.
Finally I am calling the - "GetReport" with the "GeneratedReportId"
which I got from the call previous to this and I get the response as
the above image.
I have no idea how to parse and use it. Can't make any sense about the format returned in the final call (Shown in the image).
If anyone worked with this API. Please point me to the right direction.
Thanks in advance
Depending on the ReportType, you'll either get a XML file or a CSV file back. The ReportType enumeration page in the docs will tell you which is which. While the XML format is somewhat well documented here, the CSV files are not, but most should be self-explanatory. _GET_MERCHANT_LISTINGS_DATA_ returns such a CSV file. You may be confused by the fact that one of its fields contains some HTML.
Since you don't state which programming language you intend to use: You can open a CSV file in Excel (or LibreOffice). Please note that unlike most CSV files, these are separated by tabs, not by commas or semicolons. Also, to answer your initial question: yes, this is normal.

Download Webi report from Excel

With newly released Webi there's no way to manipulate reports with VBA like it was in DESKI era.
I'd like to know if there's a way for me to click a button with parameters in Excel sheet and get a report from the server?
I've been thinking of using the RESTful Web-services but it seems that there is a performance problem.
I also considered using a JAVA app in the middle using the SDK but it's not really satisfying as I add one layer.
Do you know if there's an other way to download a Webi report from and to Excel?
For this type of requirement, you'd normally use the OpenDocument feature. There is one thing that it won't do however, at least not for Webi documents, and that is deliver the output in Excel format (HTML and PDF are the two possible formats for Webi). In all fairness, the export to Excel option is only about two or three clicks away, but I can understand that this wouldn't be an ideal solution.
Another option is the Java SDK, which I would not recommend, as the ReBEAN SDK (the part of the Java SDK you need to interface with Webi documents) is deprecated and replaced by the REST SDK.
The REST SDK would be the way to go if the OpenDocument feature is not sufficient. Keep in mind that this would involve quite a few steps, each time sending a command to the WACS server and then decoding the answer. The steps would be:
Authenticate and get a logon token
Refresh the document (if necessary pass prompt values)
Export the document to Excel
Close the document
The REST interface is only supported on the WACS server, which should run on your BI4 server (unless you have a customised landscape). If it's slow, I would suggest looking into the root cause of this performance issue, instead of discarding the SDK altogether.
If you're going to use the REST interface, I would recommend opting for JSON to communicate through REST instead of XML. It's easier to read and parse.
A last option, which I wouldn't recommend, is LiveOffice. This is a separate product which allows you to embed contents from Webi documents into Office documents (most notably Excel). LiveOffice has always had its share of problems and has not received much love from SAP regarding much needed updates.
One final thought: the report will never appear in the same sheet, at least not without an additional amount of coding. Whatever SDK you end up choosing, you will always end up with an Excel file. If you want to show the results in the Excel file you started from, you'll need to code the steps to open the generated file, grab the contents and then copy those to your worksheet.

Input data recieved from an email into a CSV/Excel/LibreOffic Calc file

Having a bit of trouble with a script I am trying to create. Basically I would like it to send out a reminder email to send hours I worked that day, then I send a reply, the script will read the email for date start time and end time and then input this data into a CSV/Excel/LibreOffic calc file. A new line for each date. I have manage to sort out the email sending and reading part, then inputting the data into a variable for the next subroutine to read (the excel bit). But I am not sure on how to go about this part. I have seen many suggestions of using Text::CSV and other modules but i'm not certain on how to use them? also how would I go about making it append to the end of the document instead of just overwriting it?
Thanks in advance guys
CSV is very easy to read and parse, and Text::CSV is very easy to use too. What specific problems are you having with Text::CSV, and what have you tried?
If you want true Excel format, it looks like you'd need to read the existing contents with something like Spreadsheet::XLSX, write it back out using something like Excel::Writer::XLSX, and append your data to it as you're back out the original data.
CSV is simpler, though, if you can live with it. You could open the file in append mode, and just write to it. To do so, build up your data into columns, and "combine" them ($csv->combine (#columns)), then create a string out of that ($csv->string()) that you can write to your original file.

Resources