Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I am loading some fields from sharepoint list (view) using the below load statement:
LOAD
[1. Practice Area ] as [Practice Area ] ,
[2. Application ] as [Application ] ,
[3. Project Name ] as [Project Name ] ,
FROM
[sharepoint path]
(html, utf8, embedded labels, table is @292);
Now I have observed that after few reloads data is not available at '@292' and its moving up.
For example, now its at available at 292 but tomorrow it will be at 291 and 290 after few hours.
can we write the load statement which will bypass the reload if load fails?
For example, if the load with @292 fails with error message like
5/31/2015 6:35:04 AM: General Script Error
5/31/2015 6:35:04 AM: Execution Failed
5/31/2015 6:35:04 AM: Execution finished.
ignore the load and go to next load which will have 291
LOAD // execute this load if load is successful, if returns above error, ignore this load and go to next load
...
(html, utf8, embedded labels, table is @292);
LOAD // execute this load if load is successful, if returns above error, ignore this load and go to next load
...
(html, utf8, embedded labels, table is @291);
LOAD // execute this load if load is successful, if returns above error, ignore this load and go to next load
...
(html, utf8, embedded labels, table is @290);
Try something like this:
SET ErrorMode = 0;
LOAD
...
(html, utf8, embedded labels, table is @292);
IF ScriptError > 0 then
LOAD
...
(html, utf8, embedded labels, table is @291);
ENDIF;
IF ScriptError > 0 then
LOAD
...
(html, utf8, embedded labels, table is @290);
ENDIF;
SET ErrorMode = 1;
Try something like this:
SET ErrorMode = 0;
LOAD
...
(html, utf8, embedded labels, table is @292);
IF ScriptError > 0 then
LOAD
...
(html, utf8, embedded labels, table is @291);
ENDIF;
IF ScriptError > 0 then
LOAD
...
(html, utf8, embedded labels, table is @290);
ENDIF;
SET ErrorMode = 1;
Look into error variables in the HELP.
Set ErrorMode = 0;
LOAD * FROM FirstTable;
IF ScriptError = 0 THEN
LOAD * FROM SecondTable;
END IF
Perhaps something like this:
set ErrorMode=0;
LOAD
[1. Practice Area ] as [Practice Area ] ,
[2. Application ] as [Application ] ,
[3. Project Name ] as [Project Name ] ,
FROM
[sharepoint path]
(html, utf8, embedded labels, table is @292);
if ScriptError=10 then // table not found
LOAD
[1. Practice Area ] as [Practice Area ] ,
[2. Application ] as [Application ] ,
[3. Project Name ] as [Project Name ] ,
FROM
[sharepoint path]
(html, utf8, embedded labels, table is @291);
if ScriptError=10 then
...etc...
end if
end if