Can you have a "scratchpad" similar variable in the Flow Designer for a subflow like you can for a workflow?

Sara3
Giga Guru

I need a way to have a "scratchpad" type of variable in the Flow Designer for a subflow.  I have been unable to find a way to create a variable that can be set to a value and used further down in the subflow, similar to what you would do in a workflow (only this would be used in the Flow Designer with a subflow.) 

I am trying to set a variable that I can use further in the subflow to reference a sys_id.  I will then use the variable with the sys_id to do a lookup to find the record that needs to be updated.  Is this possible with Flow Designer?

9 REPLIES 9

Sara3
Giga Guru

find_real_file.png

santoshsahoonis
Kilo Guru

They don't have it right now. (Refer KB0817612)
find_real_file.png
There seems be only one way of doing this.
1. Create a Custom table
2. Create a Flow Action with a Script step that Insert/update/delete/get records in this custom table

3. Wait for Servcienow to release the new feature 😄

P.S: Custom tables are now Licensed 

Brent Sutton
Mega Sage

Hi Sara,

I discovered your post as I too was looking for a way to use scratchpad in ServiceNow flows.

Since scratchpad still isn't available, I settled on a workaround which uses custom system property to store my "scratchpad" value. I then refer to the system property value for the remaining steps in my flow.

I typically use this technique for scheduled flows where I don't have multiple instances of your flow running at the same time i.e. scheduled batch jobs.

  1. Lookup your custom property
  2. In the next step populate your property's value with your temp "scratchpad" value
  3. Refer to the property value in subsequent steps using the data pill
  4. Or refer to the property value in code
  5. Clear the property for use in the next flow

I find this to be a useful workaround for the lack of scratchpad functionality in Flows at present. It also doesn't require custom tables which will have a licence implication.

If you found this information useful, then please mark as helpful or correct.

Thanks,

Brent

Community Alums
Not applicable

This is a very bad solution - setting a system property typically causes a 'cache refresh' on all your nodes. If your flow runs rarely, you will probably not notice. However, if your flow runs very frequently, this may cause severe performance issues.

In general, only use properties for true 'settings' - not for dynamic data.

A better solution would be a custom 'script action' as defined above, that has a certain output, you can then use the data-pill output variables of that action.

See also:

https://community.servicenow.com/community?id=community_blog&sys_id=53dd6ae9dbd0dbc01dcaf3231f961999

Travis Rogers
ServiceNow Employee
ServiceNow Employee

Hi Sara - ServiceNow released the scratchpad equivalent for Flow Designer with Quebec, now called Flow Variables. Enjoy!

What’s new with Flow Designer in Quebec