Debug Errors in Flows

terrieb
Tera Guru

Running some debugs on a flow because it is not running when a Request is created.

 

Tried adding a "wait for duration of time" flog logic.  That failed and when I debugged it, it said that was the issue.

So, I removed that flow logic and tried again.

 

This time the debug had an issue with the "Get Catalog Variables" action.  So I deleted it, readded it, saved the flow and activated it with no errors.

 

Created a new request and it stalled again - went back and re-ran the Debug and got the same error.  I checked the Pill Compound list and nothing generated.

 

Looking for a resolution - because if I hit Test on the Flow and select the RITM it didn't automatically generate - it works with no issue but we can't be jump starting every single Request this way...

 

Look at screen shot attached

 

Thanks!

 

P.S. We are in the process of a major project creating about 25 - 30 catalog items with their own flows.  They work just fine in our Dev instance, but failing in the Test instance.  

 

I checked BR's and they match between instances...

5 REPLIES 5

Tanushree Maiti
Kilo Patron

Hi @terrieb 

 

Refer this KB1002825:The "Get Catalog Variables" Flow Action will return Outdated Variables 

 

As per this KB, Using the "Get Catalog Variables" Flow Action multiple times will return Outdated Variables and this is expected behavior and by design in all currently supported releases.

 

Workaround

This is expected behavior and by design in all currently supported releases.

 

Reasoning:

The "Get Catalog Variables" Action is in sync with the "Look Up Record" Action and it will retrieve the values from that GlideRecord.

Therefore if you retrieved the GlideRecord at the start of the Flow but use it later in the "Get Catalog Variables" Action then you are providing an outdated GlideRecord and it is expected to return these values.

 

Issue Prevention:

You can use a "Look Up Record" Action on the Step before the "Get Catalog Variables" Action to ensure that you are collecting the Values from the Database and they will be up to date.

 

As an alternative option you can also use the following:

  1. Please set the "Submitted Request Item" Input to the "Get Catalog Variables" Action to use a newly generated GlideRecord for this Request Item
  2. You can do this by using the following Script instead of the Request Item Data Pill

Script Input:

var gr = new GlideRecord('sc_req_item');
gr.get(fd_data.trigger.request_item.sys_id + '');
return gr;
Please mark this response as Helpful & Accept it as solution if it assisted you with your question.
Regards
Tanushree Maiti
ServiceNow Technical Architect
Linkedin:

I did the Issue Prevent steps

 

Added a Look Up Record action on the step before Get Catalog Variables Action 

 

I also updated the Update Record action for the Request table to point to the Look Up Record instead.  Flow still failed to run.  Doesn't even appear in the Operations view to troubleshoot what happened.

 

I did a Debug on the flow pointing to that new RITM and now there is an error in the Look Up Record action.

 

 

Hi @terrieb ,

 

Instead of using Debug, did you tried using Test to run the flow?

Yes and while it states the Test was run successful, it does not move the flow forward.