Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Catalog Item variable in SCTASK

StefanSrba
Tera Contributor

Hi all!

I have a Flow that Creates Catalog Task. It uses Catalog Item variable is_this_repairable_under_warranty.

StefanSrba_0-1760700811730.png

I have made that this variable is mandatory when closing task (Closed Complete) with UI Policy (match Short Description).

StefanSrba_1-1760701046000.png

This IF is not triggering okay because when flow Creates Catalog Task and Task is Closed Complete the variable is not 'caught' it stays empty untill next run.


I've tried action Wait for Condition - but this did not work either.

StefanSrba_2-1760701162843.png

What am I missing? Can I even do this?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@StefanSrba 
if you use the earlier "Get Catalog Variables" action output it might give you outdated variable value

Just before the IF logic you need to use "Get Catalog Variables" Flow action again to get the latest variable value.

see this KB

The "Get Catalog Variables" Flow Action will return Outdated Variables 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@StefanSrba 
if you use the earlier "Get Catalog Variables" action output it might give you outdated variable value

Just before the IF logic you need to use "Get Catalog Variables" Flow action again to get the latest variable value.

see this KB

The "Get Catalog Variables" Flow Action will return Outdated Variables 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I've added this Action step now, but it still does not work as intended..

StefanSrba_0-1760945029604.png

 

 

But I still ave the Condition being empty on the left side.

=yes

Hi!

I've added a new Get Catalog Variables and referenced that one in my IF clause and it works now!

StefanSrba_0-1760945656041.png


Thanks for the solution!