SmashedMonkey
Scholar

Problem with variables when trying to build custom history

I have built a workflow that is fundamentally an approval for overtime hours. The list is driven by a Nintex form that contains a repeating section to capture the various entries for a period of a month. That all works well, but I have a problem with capturing the history into the same list. This is because our payroll teams need visibility of an audit trail.

To achieve this, at regular points in the process, I have actions that initially retrieve history for that item, from the list column (I called it GenFormHist), which is then added to a multi-line variable varHistory. During the course of the workflow, I read, append and update that column through the same actions, also logging to the Nintex history list as well (which I believe is volatile - max 90 days?)

What seems to be happening, is that the initial history entry, when the form is first submitted in a status of New, I simply write a "New item" entry to the history column, then store that into the varHistory variable. The next actions include a condition, to see if the form has a confirmation checkbox set. If not, the form is set to a status of Draft. If true, then the status is changed to Pending.

In the draft scenario, having passed the condition and been routed through the "no" outcome, there is another set of history column read, append and write actions to record that the form has been saved as draft. On that outcome leg, the workflow then ends. 

My problem seems to be that the initial entry, the New Item entry, gets lost and does not show in the overall history. Is there something that passing through a condition switch does to the variable values? Do they get blanked or is this down to my poor workflow design - be honest!

Here are the actions concerned:

   SmashedMonkey_0-1652436817777.png

SmashedMonkey_1-1652436899944.png

SmashedMonkey_2-1652436961444.png

This is what is added in the initial history item creation:

SmashedMonkey_4-1652437338742.png

Here is the configuration of the Query List action:

SmashedMonkey_3-1652437202822.png

Finally, the Update item action:

SmashedMonkey_5-1652437425465.png

Any help, most welcome.

Thanks, Pete.

 

 

 

0 Kudos
Reply
1 Reply
MegaJerk
Collaborator

Re: Problem with variables when trying to build custom history

What does the second varHistory variable update look like (as in the contents of the Set Variable action for instances beyond the first one that is set when GenFormStatus === "New")?

 

 

0 Kudos
Reply