There doesn't appear to be any specific option to do this on the data page rule form. However, you should be able to achieve this by having the activity/data transform that's loading your page to evaluate any errors and doing a page-remove/remove when they exist. Or in the Data Page rule form has a field for running a Post load processing activity that you could write to check for errors and remove the page when they exist.
I think the latter option is probably your best bet.
Brendan Horan Manually i am able to Expire/Remove the data page in Activity or Data transform where i am trying to refer the data data page, but unable to implement same logic in Post load processing Activity or Load activity.
I have tried to remove Data page in post load process through simple Page-Remove/@(Pega-RULES:DeclarePages).ExpireDeclarativePage(tools,D_DataPageName)/Java code, but the page is not getting removed.
@(Pega-RULES:DeclarePages).ExpireDeclarativePage(tools, D_DataPageName) returns false if i used in load or post load processing activity and also i have seen below note in PDN article i.e., (Do not attempt to reference the currently loading data page from within the response data transform. This method does not work and can cause errors when you try to load the data page.)
In our application we are using "Copy data from a data page" data access option available for single page / page list properties. Because of this we are looking for solution that deleted/expire the error data page automatically.
We have the same issue in our application (we are on 7.1.7). When the source is not available, an empty Data page is getting created and getting cached. This gets only refreshed after the configured Refresh Interval is reached. We tried Page-Remove in Post load processing and also tried calling FlushDeclarativePage activity but nothing worked. Still a blank data page is getting created.
I have implemented below approach to flush error/empty datepage
Create standard agent runs for every 30 sec and manually created one instances of XYZ data class with data page name along with parameters.and tried to que the same recod/instance to standard agents which runs for every 30 sec to flush the datapage with parameters.
Hope this helps you and let me the approach that you have implemented.