Jump to content

Count of how many times something has looped...


Guest Paul Alexander

Recommended Posts

Guest Paul Alexander

I'm setting up a BPM where an email is sent asking the requester if they want their request updated (it's for sabbatical leave, the return date of which is set, but the employee doesn't always come back - so we're asking the Line Manager whether this person has returned to work or not)

What we'd like to do is send the email, then suspend the call waiting for an update. If there hasn't been a response within a week (measured by setting the 'expiry' on the suspend node) resend the email. What we need though, is to be able to set this to only go round this loop a set amount of times. 

So, what I'm looking for is a counter (possibly something set up in the integrations node to count how many times this particular node has been 'fired'?) and, once this counter reaches a particular number, to exit the loop.

Is this something that's already possible in a BPM? Or, if not, is it something that could be added please?

thanks

 

 

Link to comment
Share on other sites

  • 4 months later...

Hi @Victor

I'm trying to achieve something similar. In a change I want a loop when the change manager sends the request back to the owner for more info. I've arrived at the conclusion above too, but I don't know how to execute it. I want to use h_custom_30 to store a counter. Is it as simple as adding '+1'? Or do I need more syntax? Presumably something like h_custom_30 = h_custom_30 + 1?

Any help would be gratefully received?

Thanks

Link to comment
Share on other sites

Guest Paul Alexander

Hi @chrisnutt

I couldn't get the '+1' bit to work on mine (I'm sure it's easy, but I just couldn't get it to work) so I ended up just doing adding '&[global["flowcode"]["customField40"]]1'

That then gives you:

1

11

111

I check with a decision tree at each time round and, if the field value is 111 then I exit the loop (I only want it to go round 3 times). 

 

I don't know if that helps? 

Link to comment
Share on other sites

Just now, Victor said:

@chrisnutt where exactly are you using the variable?

In a hornbill automation node, against the h_custom_30 field

1 minute ago, Paul Alexander said:

That error is fine.......I get it with all of my javascript additions but it doesn't stop things working.

Good to hear. Will give it a whirl when I've finished all the other bits and bobs.

Chris

Link to comment
Share on other sites

1 hour ago, chrisnutt said:

In a hornbill automation node, against the h_custom_30 field

Pics or it didn't happen!

On a serious note, any screenshot of how you use it? Because when used as update content for a custom field, the BP should not report that message...

Link to comment
Share on other sites

2 hours ago, chrisnutt said:

Hi @Victor

One for when you're back. I'm getting a warning with that. I've not yet tested it. Attached is the warning message.

Chris

HB_increment.png

@chrisnutt

I managed to get that warning by using the wrong variable: My Get Request Details node had a Result Reference of task, so the variable was &[global["flowcoderefs"]["task"]["customField30"]] and the code in the update node became &[parseInt(global["flowcoderefs"]["task"]["customField30"])+1]

Link to comment
Share on other sites

  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...