I have a process which at certain scheduled times does a Retrieve Items, Create Job and Create Output. The Create Job action is showing error W4203: Metadata does not contain valid Content Item Collection. There will not necessarily be any items to retrieve every time that the process runs so instead of producing this error I’d prefer to have a condition immediately after the Retrieve Items to say “If no items received, stop the process”. Is this possible and if so how?
If there is content to be picked up I don’t get the error and if there is no content nothing is output, however it would be neater if the process could stop gracefully rather than logging an error message.
You could either catch the error in Create Job using the On Error tab which could be instructed to Stop Process.
OR
What I’d likely do is have a Text Condition immediately after the Retrieve Items plugin which simply checks for a property or value in the first Document of the generated metadata and stops any further processing where it doesn’t exist.
So the Text Condition would check for something like:
is equal to <blank> which then goes to a Delete step so no further processing happens.
NOTE: myProperty is set using Set Properties earlier in the process. Alternatively you could look for a data field (value) in the first document.
Retrieve Items will always return at least one document level in the metadata so this way, we know if we get blank, it has found nothing. Make sure you set the output type in Retrieve Items to metadata to be able to query properties and fields.
Hi douglasb, yes it is possible to do so.
When you retrieve items, you could find those in the metadata.
So you can add a condition just after the retrieve item where you would count the number of documents or try to get the value of a specific record.
If you get 0 documents, then you know you can stop the process.
I hope this is helping you.
yes you are right @jim3108, you will get at least 1 document.
This is a filter plugin that may return 0 document.
So the text condition is the right way
Thank you both. I now have a text condition that looks for the property immediately after the Retrieve Items action which branches to a Delete if the expected value isn’t found. It appears to work.
I have an excel lookup table that replaces metadata fields. It has 8 lookup columns. How would I go about combating the “no valid item found” where the majority of fields have replacement data, but some don’t. ie. name, address1 and address2 always have data, but address3 doesn’t. This throws the error
Apologies, the excel lookup process isn’t causing the problem in the end. I’m trying to produce output by loading a metadata file, this is what is causing the problem…
[0058] Starting plugin Create Print Content - 08:23:36
[0058] Source data is MetaData
[0058] Creating the rest client
[0058] [2023-08-15 08:23:38.360] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:38.633] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:39.062] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:39.513] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:39.978] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:40.395] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:40.762] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:41.141] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:41.533] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:41.849] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:42.250] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:42.727] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:43.130] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:43.470] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:43.880] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:44.251] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:44.719] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:45.177] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:45.514] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:45.773] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:46.189] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:46.504] Print content creation> Sent a batch of 25000 fields for update
[0058] [2023-08-15 08:23:46.883] Print content creation> Sent a batch of 20400 fields for update
[0058] Records updated from metadata
[0058] Using cached file (id = 2870006).
[0058] Starting content creation operation…
[0058] [2023-08-15 08:23:47.182] Print content creation> Retrieving results [0058] W3001 : Error while executing plugin: HTTP/1.1 500 Internal Server Error - An unspecified error occurred which was caused by LoggedApplicationException: There was an error running the content creation process caused by ApplicationException: No record found with ID 2133184 (SRV000022) (SRV000001)
** [0058] Create Print Content: W1603 : Plugin failed - 08:23:47 (elapsed time: 00:00:10.317)**