Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kenji_khoo
Partner - Contributor
Partner - Contributor

Failed in QMC read Sharepoint

Hi All,

Below is my script. Run successfully locally but failed in QMC. Any idea? Any solution?

let vPath = '\\XXXXXXXXXXXX.sharepoint.com@SSL\DavWWWRoot\sites\Shared Documents';

DO while vCheck=0

LET vFileSize=filesize('$(vPath)\Country\*.txt');

trace $(vFileSize);

//**Explaination: if file exists

IF vFileSize>0 then

trace 'success';

    exit script;

ELSE

//**Trigger an email

//**Explaination throw an error, qlik task will stop

LOAD B;

LOAD * Inline [

Col1

A

B

];

ENDIF

LOOP;

let vCheck=0;

8 Replies
tamilarasu
Champion
Champion

Hello Kenji,

Does your server having access to the below sharepoint path ? I think it is not having access. Check it once.

\\XXXXXXXXXXXX.sharepoint.com@SSL\DavWWWRoot\sites\Shared Documents

kenji_khoo
Partner - Contributor
Partner - Contributor
Author

Hi Tamil Arasu,

Yes, it can access. Via mapping network drive, https://, all are fine. If I run the QVW locally, it's fine as well. Only happen in QMC, checking on the log, the log shown it is not get the filesize and goto else statement.

Check on the user ID, is same with QDS services.

tamilarasu
Champion
Champion

Hi Kenji,

Here is the answer for your question.

Capture.PNG

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I think that, since your UNC path appears to be correct, the problem may still be caused by access permissions or environment differences.

Can you try running a reload under QMC control of a document with just this script?

LET vPath = '\\XXXXXXXXXXXX.sharepoint.com@SSL\DavWWWRoot\sites\Shared Documents';


FOR EACH vFile in filelist(vPath & '\Country\*.txt')

  TRACE >>>> Trying to determine size of file [$(vFile)];

  LET vFileSize = FileSize(vFile);

  TRACE      Size appears to be $(vFileSize) bytes;

NEXT


Best,


Peter

kenji_khoo
Partner - Contributor
Partner - Contributor
Author

I'm using UNC path, but not https.

tamilarasu
Champion
Champion

Did you try pcammaertsuggestion?

kenji_khoo
Partner - Contributor
Partner - Contributor
Author

Not working. 😃

tamilarasu
Champion
Champion

I haven't worked in sharepoint connectivity. So it is bit hard for me to guess what is the real reason. Could you post the log file so that someone can help you.