Solved

Update Document Metadata and Error Handling


Badge +10

I have to implement a logic to check if a document exists in a document library using a key field. If document exists, update a custom meta data column. But when document doesn't exist, workflow throws error. How to bypass this error if document doesn't exist?

Thanks!

icon

Best answer by boringNerd1 21 May 2018, 09:28

View original

2 replies

Badge +15

Hi,


 


Here's what I will do:


 



  1. Create a data field (eg. DocExists), and set the default value to -1. This data field will be used to check if the document exists

  2. Create an activity, which contain just a SmartObject Event.

  3. Configure the SmartObject Event to call the Get Document Metadata method, and for return mapping, map the ID to the data field created in 1.

  4. Right-click on that activity , go to Properties, select the last tab, and check on 'Enable exception rule'. So this basically catches the error, but if you do not check on the remaining two options, this error will not get logged.

  5. Create two path, and add the following line rules to the two line:

    1. Line 1: If data field >= 0. This is the path where the document exists

    2. Line 2: If data field < 0. This is the path where the document does not exists



Badge +10

Thank you very much! This is exactly what I wanted to do.

Reply