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: 
konidena
Creator
Creator

General Script Error in statement handling while fetching data from sharepoint by using inbuilt office 365 connector

Hi Team,

I have a sharepoint location. This location has multiple subfolders. Every week the business users used to update the subfolders with excel or csv files. I need to fetch the data from latest files. If the file is used once, it shouldn't be considered again for the reload.

I kept every subfolder path in inline load and used the below script to fetch the files details from each sharepoint folder and then saving them into a table . while doing this, I am getting the  error "General Script Error in statement handling". It is not specifically coming at one location. everytime it is coming in different different sub folder.

 

Office365Connector_ListFolders:
Load * Inline
[
CustomFolder
QS_MSMART_UK/0_LocalData/Mapping
QS_MSMART_UK/0_LocalData/Configuration
QS_MSMART_UK/0_LocalData/05_03_Neurology_Patients/ROI_REBIF/Configuration
QS_MSMART_UK/0_LocalData/00_09_Local Channels
QS_MSMART_UK/0_LocalData/01_01_Oncology_Sales
QS_MSMART_UK/0_LocalData/01_01_Oncology_Sales/Average Selling Price
QS_MSMART_UK/0_LocalData/01_02_Oncology_MarketData/UK/Cash
QS_MSMART_UK/0_LocalData/01_02_Oncology_MarketData/UK/Units
QS_MSMART_UK/0_LocalData/01_02_Oncology_MarketData/ROI/Cash
QS_MSMART_UK/0_LocalData/01_02_Oncology_MarketData/ROI/Units
QS_MSMART_UK/0_LocalData/01_02_Oncology_MarketData/SSD for Iconnect
QS_MSMART_UK/0_LocalData/01_04_Oncology_Targets
QS_MSMART_UK/0_LocalData/01_04_Oncology_Targets/KAM_Targets
QS_MSMART_UK/0_LocalData/01_04_Oncology_Targets/OP_Targets
QS_MSMART_UK/0_LocalData/01_05_Oncology_RAS_Targets
QS_MSMART_UK/0_LocalData/01_06_Oncology_RAS_Actuals
QS_MSMART_UK/0_LocalData/01_07_Oncology_Potential
QS_MSMART_UK/0_LocalData/01_09_Oncology_Other_Data

];

LIB CONNECT TO 'Office_365_Sharepoint_Metadata';

For Each vFolderTmp in FieldValuelist('CustomFolder')

Office365Connector_ListFiles:
LOAD UniqueId as [ListFiles.UniqueId], 
Name as [ListFiles.Name],
updated as [ListFiles.updated],
TimeCreated as [ListFiles.TimeCreated],
TimeLastModified as [ListFiles.TimeLastModified],
'$(vFolderTmp)' as CustomFileFolder
;
SELECT UniqueId,
Name,
updated,
TimeCreated,
TimeLastModified
FROM ListFiles
WITH PROPERTIES (
subSite='/sites/M-Smart_Application_Data/',
folder='/sites/M-Smart_Application_Data/Shared Documents/Prod.group.com/$(vFolderTmp)/',
maxResults='1000'
);

 

Let vFolderTmp='';
 
Next vFolderTmp;
 
Drop Table Office365Connector_ListFolders;
NoConcatenate
SP_File_ID:
Load 
[ListFiles.Name] as File,
[ListFiles.UniqueId] as ListFiles_UniqueId,
[ListFiles.updated] as ListFiles_updated,
[ListFiles.TimeCreated] as ListFiles_TimeCreated,
[ListFiles.TimeLastModified] as ListFiles_TimeLastModified,
CustomFileFolder
Resident Office365Connector_ListFiles;
 

store SP_File_ID into [lib://APP_MSMART_UK_Confi/Local Datastore/1_Extract/SP_File_ID.qvd] (qvd);
Drop Table SP_File_ID;

Drop Table Office365Connector_ListFiles;

 

 

Please let me know what is the exact issue here. Syntactically the code is correct but i am not able to understand where exactly the issue is coming. Please help me here if any one has idea on this 

 

Labels (1)
1 Reply
Anil_Babu_Samineni

@konidena What it says when you use Debug mode? Is there any file that showing the error or ?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful