Skip to main content
Announcements
Marching toward a simplified navigation! READ ON
cancel
Showing results for 
Search instead for 
Did you mean: 
sayadutt
Creator
Creator

Conditional load based on failure

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);

1 Solution

Accepted Solutions
sunny_talwar

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;

View solution in original post

3 Replies
sunny_talwar

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;

swuehl
MVP
MVP

Look into error variables in the HELP.

Set ErrorMode = 0;

LOAD * FROM FirstTable;

IF ScriptError = 0 THEN

LOAD * FROM SecondTable;

END IF

Gysbert_Wassenaar

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


talk is cheap, supply exceeds demand