How to get last time a workflow was run from within a workflow

  • 4 October 2017
  • 1 reply
  • 5 views

Badge +1

I want to create a site workflow that sends mails based on the values of some fields in a list. I know that I could trigger it on "item changed" if it was a list workflow. But since we are using someting called GetOrganized I'm not "allowed" to make a list workflow on that list. I then need to make a site workflow that runs at some interval. But I only want to send mails on items changed since last time i ran the workflow to avoid sending mails regarding the same item more that once. So how do I get the time of the last time the workflow was run? And even better - can I somehow know if the change was on one of the fields I'm inspecting? I.e. - can I query the item history?

Regards

Lars Peter


1 reply

Userlevel 5
Badge +14

you will need to use web service call for both information.

to get workflow history log use Workflow.asmx  service and its GetWorkflowHistoryForListItem method

see reference here https://help.nintex.com/en-US/sdks/sdk2013/#Reference/SOAP/NW_REF_SOAP_GetWorkflowHistoryForListItem.htm%3FTocPath%3DNin… 

and usage example here Get Task History and display on your form. 

to get item version history use Versions.asmx web service and its method GetVersions

see reference here Versions.GetVersions Method (Versions) 

and usage example eg. here  

Reply