Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II

How to read an attached excel with Qlik Mailbox Imap connector

Hello:

I have to read an excel file attached to a mail in a QlikView document.

I have well configurated de connector, and I'm able to read all the tables included on the conector but when I try to use the tables MessageGetAttachmentAsText (or Binary) I get the data in an unreadable format.

I have been trying some differents formats on script, getting unreadable data or this error:

Error: File extdata.cpp, Line 2348

MailboxIMAPConnector_GetAttachmentAsText:

LOAD

    *

FROM

[http://qlikpublisher:5555/data?connectorID=MailboxIMAPConnector&table=MessageGetAttachmentAsText&Ser...]

(qvx)

Could you help me, please ?

I have attached some pictures to show you that the connector is working

Thank you

Joaquín

16 Replies
Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II
Author

Steve, could you write here a TargetPath syntax sample ?

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

It requires a URL encoded version of where you want to write your file. I have a sub to do the URL encoding.

sub Encode(vEncodeMe, vEncoded)

let vEncoded = replace(replace(replace(replace(replace(replace(replace(replace(vEncodeMe, ':', '%3a'), '/', '%2f'), '?', '%3f'), '=', '%3d'), '\', '%5c'), '@', '%40'), ' ', '+'), '_', '%5f');

end sub

let vTargetFolder = 'c:\myfolder\myfile.xlsx';

call Encode(vTargetFolder, vTargetURL);

[$(vConnector)&table=MessageDownloadAttachment&Server=$(vServer)&SSL=$(vSSL)&Port=$(vPort)&Username=$(vUserName)&Password=$(vPassword)&MessageID=$(vUID)&AttachmentFileName=$(vFileURL)&TargetPath=$(vTargetURL)]

I think all the other parts are present and correct in your query.


Steve

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II
Author

The LOAD sentence ignores the TargetPath clause and do the same as before

chrisbrain
Partner - Specialist II
Partner - Specialist II

Hi - Could you confirm the QWC version you are using?

Also - if possible, could you turn on the browser developer tools and see if there are any errors reported which might hint at why the parameter isn't showing for you?

In any case - I would expect the AsBinary table to work here - if you can connect to me over this site I could try and arrange a webex to take a look at your setup.

beeido.com - BI | Software | Qlik Integration Services
GitFirst - A CI/CD solution for Qlik Sense
Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II
Author

Hi Chris:

This is the QWC  Connector Version: 1.0.1.21949


I've requested to Systems Departament they upgrade it, then I will try again and let you know about new results


By the way, Binary works as bad as Text


Thanks for your colaboration

Joaquin_Lazaro
Partner - Specialist II
Partner - Specialist II
Author

Hi Chris & Steve:

Finally it works without upgrade QWC 

As Steve wrote before "I would always do this as a two step thing. Write the attachment to a file first and then read from that file."  ...

First step is MessageDownloadAttachment this download (from the mail server) the attach to a local folder and creates a record in the sript table MessageDownloadAttachment with a field Status filled 'OK'


Second step is upload the attached file to script a load * from .xlsx sentece


I was doing wrong the script and I wasn't able to see it


Thanks you very much for your colaboration

Joaquín

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Joaquín,

Glad it is working. Thanks for confirming back.

Cheers,
Steve