Is it possible to use javascript in the value field of a Flow record trigger condition?

stuartgriffiths
Tera Expert

I have attempted to convert some async business rules to flows. The business rule filter conditions included some javascript in the values, for example javascript:gs.getProperty('my_property_name')

find_real_file.png

The business rules trigger as expected.

However, if I configure the same condition into the flow, like this...

find_real_file.png
...when I minimise the Trigger section of the Flow form, the summary of the trigger shows 'undefined', e.g. 'Correlation Display is undefined'.

find_real_file.png

Testing shows that the flow does not trigger.

If I amend the conditions to remove the javascript from the condition and replace it with static value, the Flow triggers.

Can anyone advise if what I'm trying to do is supported in Flow Designer?

Thanks.

Stuart.

1 ACCEPTED SOLUTION

stuartgriffiths
Tera Expert

ServiceNow have confirmed this is not currently possible with Flow trigger filter conditions. They've suggested raising an enhancement if I feel the functionality would be of wider benefit. I'm happy to take feedback on that through this thread.

To achieve my desired outcome I used a hybrid approach, using business rules to act as the trigger - allowing me to use javascript in the filter conditions where required  - and adding a scripted call to a subflow (code snippet tool in flow designer makes this pretty easy).

It means there are more 'moving parts' in the solution that if I'd used either just Flow or just business rules, but I'm keen to leverage Flow with an eye on future support and the direction of travel of the platform towards Flow Designer-based solutions.

View solution in original post

7 REPLIES 7

I appreciate you're trying to offer options, but I just need an answer to the specific question at this point. Just thought I'd try the community before raising a HI case.

Thanks.

stuartgriffiths
Tera Expert

ServiceNow have confirmed this is not currently possible with Flow trigger filter conditions. They've suggested raising an enhancement if I feel the functionality would be of wider benefit. I'm happy to take feedback on that through this thread.

To achieve my desired outcome I used a hybrid approach, using business rules to act as the trigger - allowing me to use javascript in the filter conditions where required  - and adding a scripted call to a subflow (code snippet tool in flow designer makes this pretty easy).

It means there are more 'moving parts' in the solution that if I'd used either just Flow or just business rules, but I'm keen to leverage Flow with an eye on future support and the direction of travel of the platform towards Flow Designer-based solutions.

Hi Stuart

I currently have the exact same need, while trying to make less use of business rules and move to the future leading flow designer.

Did you open an idea in idea portal? I would support it though

Or were you able to fit your needs in any other way?

Thanks
Simon