SmashedMonkey
Scholar

Problem with variables when trying to build custom history

Jump to solution

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
5 Replies
MegaJerk
Collaborator

Re: Problem with variables when trying to build custom history

Jump to solution

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
SmashedMonkey
Scholar

Re: Problem with variables when trying to build custom history

Jump to solution

Hi, sorry for the late response, I have been on leave for a week. So, the second varHistory update looks like this in the config:

SmashedMonkey_0-1653400246406.png

 

 

0 Kudos
Reply
MegaJerk
Collaborator

Re: Problem with variables when trying to build custom history

Jump to solution

There doesn't really appear to be anything wrong with your procedure, or at least what I see of it. 

 

  • Populating varHistory with an initial value

 

  • Updating the Column with varHistory

 

  • Retrieving the value of the Column and using it to set varHistory's value

 

  • Updating varHistory with *some value* + varHistory 

 

  • Updating the Column with varHistory 

 

all seem like standard straight forward and correct things. Without taking a look at the workflow in question, it is difficult to tell where the problem lay. I would recommend doing a mockup test workflow that follows the general flow but just updates a variable and the column in question with arbitrary data to see if you can't sort out what's going on. If your mockup works then at least you know that something else isn't broken and perhaps it's just an oversite in either how something is being set or an unexpected branch being taken in the workflow. 

Reply
SmashedMonkey
Scholar

Re: Problem with variables when trying to build custom history

Jump to solution

Thanks @mega I basically did what you suggested and stripped everything out, then added them back in. It worked from that point. I can only assume that I got a value slightly wrong or the action itself was damaged in some way. I have seen evidence of that before. Many thanks.

0 Kudos
Reply
MegaJerk
Collaborator

Re: Problem with variables when trying to build custom history

Jump to solution

We've all been down the tiresome road of something appearing correct, but not working correctly. I'm glad that you got it working!

0 Kudos
Reply