Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change field value after 24 hours

Hannah C
Giga Expert

Hello,

I have a choice variable on a table called Remote Access Account (u_nhl_remote_access) with choice options:

  • Pending (pending)
  • Complete (complete)
  • Request Again (request_again)

The default value is pending. When the value is changed to request_again, I want the value to stay as request_again for 24 hours then automatically be set back to pending.

I have tried using this business rule: (using 30 seconds instead of 24 hours for testing)

find_real_file.png

find_real_file.png

 

But this is not working. When I select request_again, it will say "Running transaction" for 30 seconds then update. I want the field to save and then I an keep doing other things, come back in 30 seconds and it be updated to pending.

Any help would be greatly appreciated! Thank you!

1 ACCEPTED SOLUTION

Cody Smith _ Cl
Tera Guru

Hello Hannah,

I would suggest using a workflow for this. You could use a Timer in the workflow to wait 24hours and a WaitFor Condition to check that its all good still. Then add the script after that to update your field back to pending.

Let me know if you need help with this.

If my answer was helpful, or solved your issue, please mark it as Helpful / Correct.
Thank you,
Cody Smith

View solution in original post

13 REPLIES 13

Assuming you're on Kingston or above, you can right click on the form header and go Configure > Flow Designer Flows to get going with the flow designer. There's plenty of documentation on how to configure them and it sounds like it might fulfill your requirement better than a fully fledged workflow.

Yes I watched a video and it was so easy to start the flow designer in this scenario! But I don't see a timer option like in a workflow...

There should be a wait for condition just like in a workflow. 

Yes there is but it waits for a condition to be met like state = closed or something, rather than waiting for a certain amount of time