Solved

Discard check-out a trigger?

  • 5 October 2017
  • 8 replies
  • 6 views

Badge +7

Hi,

 

I am using modern pages. Unfortunately, they check-in file as soon as they are uploaded. I've designed it so that they remain checked-out to user as soon as they are uploaded.

 

Now the reason is to make sure user fills in required metadata. However, users are being sneaky and doing 'discard check-out' which in turn checks-in the file without filling in metadata.

 

How can I prevent this? (without disabling discard check-out?)

 

Can I run a library workflow which runs when files are modified (is check-in a trigger for this?)

Can I run a site workflow to see if any file is checked in and if metadata is not filled in, then check them out for 'modified by' user?

 

Thanks!

icon

Best answer by TomaszPoszytek 5 October 2017, 22:41

View original

8 replies

Userlevel 6
Badge +16

Yes, you can >>> Office 365 wait for check out status change 

Badge +7

Thanks, so question:

If I set the workflow as run when 'item is modified', would it take 'discard check-out' as an action?

When I ran it so far, it didn't trigger

How can I capture user trying to discard check-out?

Userlevel 6
Badge +16

Should be 4th option.

With the action you can:


Select the "Check out" state to monitor for change:


  1. Checked out: When the document is checked out.
  2. Checked in: When the document is checked in.
  3. Unlocked by document editor: When the document is no longer being edited by an editor.
  4. Discarded: When the document's checked out status is discarded.
Badge +7

Sorry I don't have 'Wait for Check-out Status change' as it says 'Nintex external platform is required for this feature.' on the link provided.

Any other ideas?

Thanks again!

Userlevel 7
Badge +17

hehe, sure you don't - they are only in on-premise.

I did it that way for O365, and it worked:

  1. Create a text variable, but don't set any value to it;
  2. Then in your filter or wait action do a comparison - checked out to equals <that string variable>

That way you will be able to track down if the document has been checked in or not.

Now if you want to check if the document has really been checked-in, I would suggest the other approach:

  1. Set the library settings to create minor versions (0.1, 0.2, 1.1, etc...)
  2. If your case is a situation, when a user uploads a document, but does not fill metadata, but discards the checkout, that would mean the document has the 0.1 version. If checked-in in that case would have the 1.0 version. So... simply wait until the version equals 1.0

Regards,

Tomasz

Badge +7

Thank you for the long reply. I learned a few things from there.

The core issue for me is, how can I capture if a user did a 'discard check-out'?

I tried creating a workflow and set it as 'run when items are modified' and it didn't trigger!

-----

Another issue is, yes I can run a site-workflow using your tips to find out which ones are checked-in without filling in metadata. But then how do I check-it back 'out' for the actual user? (who last modified the file)

Userlevel 7
Badge +17

You can create a list workflow, that is triggered on item creation. It should capture the version of the item.

Let's assume, this is a new file - the version until user checks it in is "0".

So you should then create a variable, and calculate the version which will unpause the workflow - ex. 1.0 - that would mean, workflow is unpaused when user checks the file in. If he doesn't, the workflow stays paused.

You can create a parallel branch action and in each branch set the workflow to wait for a different value, ex. 0.1 - checked in but not published and 1.0 - checked in and published. All wrap with a state machine. Then of you move on in the 0.1 branch you can into state - "Send info to user to publish the item". If 1.0 - it the state machine and then execute your logic.

For checking in, you should use the: https://help.nintex.com/en-US/o365/o365/O365WorkFlow/WorkflowActions-INT/Office365CheckInItems.htm action, however this will not be ne on alf of a user who checked-out the file in the first place, but the app account.

Regards,

Tomasz

Badge +7

Thank you!

Reply