Question regarding "Flow designer: Create a flow" in Now Learning

CTtemp
Tera Contributor

In the Flow "Social Media Response Approvals" (in Now Learning Course "Flow Designer Fundamentals") - why does every record always end up in "Approved" state, no matter the priority level?

Thanks in advance!

1 ACCEPTED SOLUTION

Jon Hogland
Tera Guru

This was a fun rabbit hole to go down.

 

Reviewing the course, I was unable to find a reason for the flow to skip over and approve every record. I recreated it in a lab instance, and encountered the same behavior you've noted. So I began digging...

What I first noted in the test's Execution Details was that the approval field's value was being set to 'cancelled' before being evaluated by the conditions in our flow. So, it was never rejected, leading it to be approved every time. I also noticed that on the record being tested, our approvals were being set to "No longer required." Weird, right?
Screenshot 2025-02-09 at 21-36-53 Flow Designer - Operations View Social Media Response Approval Execution.png
So, to confirm that was *the* reason, I added a condition to our Approval = Rejected logic.

Screenshot 2025-02-09 at 21-38-56 Flow Designer - Flow Designer Social Media Response Approval.png

 

And the test executed Approval == Rejected successfully.
Screenshot 2025-02-09 at 21-39-53 Flow Designer - Operations View Social Media Response Approval Execution.png

So we had our flow working, but why was the flow always ending in a cancelled approval status? It turns out, our Social Media table in the use case extends from the [task] table. And further, it turns out that there is an active business rule in our [task] table called "Moot Approvals Upon Cancellation".

 

Screenshot 2025-02-09 at 21-44-26 Moot Approvals Upon Cancellation Business Rule ServiceNow.png

 

Do you see what I see? This BR was implemented, per its comments, to prevent a recursion error (I think), that caused a customer's approval table to become incredibly wonky. It seems like an extra failsafe put in place to prevent that from occurring. Well, I turned it off, and ran our test again (this time removing my 'cancelled' add-in from the equation).

Screenshot 2025-02-09 at 21-47-46 Flow Designer - Operations View Social Media Response Approval Execution.png


And hey, look at that, the flow is now in purgatory, as there is neither an accept or reject condition in place for it. In an ideal world, you'd manipulate fields per test case to verify the functionality that you're looking for. You could do this a few different ways, such as manually approving or rejecting the record to push the test along.

But yeah, mystery solved. A secret business rule! And a great lesson on table inheritance, too. I hope this was informative for you as it was for me.

Let me know if you have any questions!



If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!

View solution in original post

3 REPLIES 3

Jon Hogland
Tera Guru

This was a fun rabbit hole to go down.

 

Reviewing the course, I was unable to find a reason for the flow to skip over and approve every record. I recreated it in a lab instance, and encountered the same behavior you've noted. So I began digging...

What I first noted in the test's Execution Details was that the approval field's value was being set to 'cancelled' before being evaluated by the conditions in our flow. So, it was never rejected, leading it to be approved every time. I also noticed that on the record being tested, our approvals were being set to "No longer required." Weird, right?
Screenshot 2025-02-09 at 21-36-53 Flow Designer - Operations View Social Media Response Approval Execution.png
So, to confirm that was *the* reason, I added a condition to our Approval = Rejected logic.

Screenshot 2025-02-09 at 21-38-56 Flow Designer - Flow Designer Social Media Response Approval.png

 

And the test executed Approval == Rejected successfully.
Screenshot 2025-02-09 at 21-39-53 Flow Designer - Operations View Social Media Response Approval Execution.png

So we had our flow working, but why was the flow always ending in a cancelled approval status? It turns out, our Social Media table in the use case extends from the [task] table. And further, it turns out that there is an active business rule in our [task] table called "Moot Approvals Upon Cancellation".

 

Screenshot 2025-02-09 at 21-44-26 Moot Approvals Upon Cancellation Business Rule ServiceNow.png

 

Do you see what I see? This BR was implemented, per its comments, to prevent a recursion error (I think), that caused a customer's approval table to become incredibly wonky. It seems like an extra failsafe put in place to prevent that from occurring. Well, I turned it off, and ran our test again (this time removing my 'cancelled' add-in from the equation).

Screenshot 2025-02-09 at 21-47-46 Flow Designer - Operations View Social Media Response Approval Execution.png


And hey, look at that, the flow is now in purgatory, as there is neither an accept or reject condition in place for it. In an ideal world, you'd manipulate fields per test case to verify the functionality that you're looking for. You could do this a few different ways, such as manually approving or rejecting the record to push the test along.

But yeah, mystery solved. A secret business rule! And a great lesson on table inheritance, too. I hope this was informative for you as it was for me.

Let me know if you have any questions!



If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!

Dear Jon,

 

thank you for your efforts in finding out the reason behind the behavior we saw.

In the course, it was mentioned that "we will find out the reason why every task was approved *in the next section*" and I was wondering what it meant - next section, next module, next Chapter? May be there is a need to update the mentioned sentences? Thanks in advance.

Jon Hogland
Tera Guru

The course may be referring to the next part of that learning path, "Flow Designer: Create Subflows and Actions". On the Flow Designer Fundamentals page, it's lesson directly after "Create a Flow".

See more here: https://learning.servicenow.com/lxp/en/now-platform/flow-designer-fundamentals?id=learning_path_prev...

 



If I've at all helped, please return the favor by clicking the thumb next to my post. Thanks!