Flow Designer Action "Get System Property" - ServiceNow Community
Mark Roethof
Tera Patron
Tera Patron

Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Hi there,

 

While working with Flow Designer, you will face situations where you would need to obtain a value from a System Property. Out-of-the-box though, there's no zero code Flow Action, or something similar.

 

Since this is not out-of-the-box, what can we come up with ourselves? There are multiple ways to go. For example, with the Quebec release Flow Variables got introduced which you might use for this in combination with small scripting. Or in some cases there's a toggleable Script field that you could use. In this article, I'll share a Flow Action which I have been using for more than two years now. You might argue if the Flow Action could be enhanced, using the Error Handler which has been introduced with the Rome release for example.

It's a small Flow Action to share, though seeing the customer and Now Community questions, a small Flow Designer piece which is asked often.


Get System Property

A well-known Server Side script method to get the value of a System Property, is gs.getProperty(). As mentioned, unfortunately out-of-the-box there's no zero code Flow Action or something similar to get the value of a System Property. Also not always there's a toggleable Script field available, where you could use gs.getProperty().


Flow Action

To achieve a zero code option to obtain value from a System Property, let's set up a Flow Action.

Inputs could be:

 

find_real_file.png

Outputs could be:

find_real_file.png

find_real_file.png

 

Using the inputs and outputs we've set up, the Script step could be something like the below, using the gs.getProperty() Server Side script method:

 

find_real_file.png

Result

Within a Flow Designer Flow or Subflow, you would now have the possibility to add the Flow Action created.

 

find_real_file.png

 

Output of the Action would be a string value containing the value of the System Property.

Share

An Update Set with this Flow Designer Action can be downloaded from Share:
Flow Designer Action "Get System Property"

---


And that's it actually. If any questions or remarks, let me know!

 

C

If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.

 

Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in?
- Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

 

Kind regards,


Mark Roethof

ServiceNow Technical Platform Architect @ Eraneous

3x ServiceNow Developer MVP
3x ServiceNow Community MVP

---

LinkedIn

Comments
Mohammad Amin
Mega Guru

A couple of days ago I needed this action but there wasn't any so I moved to Scheduled Job Instead of Flow, but it will help me in the future 🙂

Thanks, Mark

bsweetser
ServiceNow Employee
ServiceNow Employee

This is an important capability, which is why we also describe how to create this Get Property action in the Developing for Flow Designer learning module on the Developer Site. I would love to see this action made available in the baseline actions provided with Flow Designer. Alternately, they could make the System Properties table available to select in the Look Up Record action to get the value...

francescaflores
Tera Explorer

A low-code approach to this could be to use a Look Up Record action to the System Property [sys_property] table. Then the property value can be accessed using data pills. 

Screenshot 2023-03-16 at 15.29.11.png

Clarkie1
Giga Expert

Look Up Record for the sys_properties table only appears to work in the Global Scope so if your flow/subflow is in a scoped app, the new action appears to be the only way to retrieve the system property value.

joanrandall66
Tera Explorer

The Flow Designer Action is a versatile and user-friendly tool for automating workflows. It's perfect for both beginners and experienced users, allowing them to create pose caption  efficient processes tailored to their needs. Whether you're automating simple tasks or complex processes, this feature simplifies the job and boosts productivity.

praestegaard
Tera Contributor

Thank you @Mark Roethof ,

I think the low-code solution presented by @francescaflores in the comments is an even better approach, and correlates with Ben / @bsweetser's request:"Alternately, they could make the System Properties table available to select in the Look Up Record action to get the value...". I checked in vancouver, and the sys_properties table is actually in the Table-picker.

 

Anders

Mark Roethof
Tera Patron
Tera Patron

@praestegaard I disagree 😀 So let's agree to disagree.

praestegaard
Tera Contributor

Sure @Mark Roethof - I don't mind disagreeing per se although i prefer understanding over opinions. I would much rather understand your rationale.

My own rationale is that in the absence of a baseline action for reading properties we can still do this record lookup while avoiding script statements, which I see as a fundamental principal of using Flow designer - avoid it where possible. Note: I am not a low/no coder my self.

Anders

Michael_Martin
Tera Contributor

Please be aware, that for some Properties, you will not be able to use "Lookup Record".
An example is "glide.servlet.uri" to determine if it's a prod or dev environment.
This one is locked and can only be accessed with a custom Script Action that uses gs.getProperty.

aidanmtx
Tera Contributor

One advantage of using a script step instead looking up the record on the sys_properties table (as suggested by @francescaflores) is that getProperty() will decrypt password2 fields, but looking up the property record and reading the value will not. If you aren't looking up a password2, it's a fine solution. I just wanted to caution anyone attempting to use it.

Version history
Last update:
‎08-04-2024 05:17 AM
Updated by:
Contributors