How to update a variable under catalog task from the flow designer

sath
Tera Expert

Hi,

 

We have a requirement of creating a user record on sys_user table from the flow and user id from that user record should be populated on one of the variables under catalog task. How do we populate the variable value on catalog task from the flow designer?

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron

@sath 

there is no direct action that updates the variables in flow designer and also it is not recommended also. But you can achieve it through the following steps - 

  1. Look up record on the sc_item_option_mtom table where 'Parent Item' is 'RITM' and 'Dependent Item.Question.Name' is 'variable name' (which variable's value you need to change) AnkurBawiskar_0-1770122519464.png

     

  2. Then look up record -  'sc_item_option' with conditions - 'sys_id' = 'Dependent Item.sys_id' (the first look up record's)  

AnkurBawiskar_5-1770122588933.png

 

3. Then Update the last look up record with desire value change - AnkurBawiskar_2-1770122519471.png

 

 

💡 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

5 REPLIES 5

jonsan09
Giga Sage

I haven't used it personally but there is a community made solution on ServiceNow Share made by @garethprice  : https://developer.servicenow.com/connect.do#!/share/contents/8236087_set_catalog_variable_flow_actio... 

VaishnaviK3009
Tera Guru

Hi @sath !!

 

Recommended Approach (Best Practice)

Populate the variable on the RITM, not directly on the Catalog Task

Because:

  • SCTASK variables are derived from RITM variables

  • Updating the RITM variable ensures consistency

Steps in Flow Designer

VaishnaviK43271_0-1770098973117.png

 

Alternative Approach (Directly update Catalog Task variable)

Use this only if:

  • The variable exists only on the Catalog Task

  • Or task-specific variables are enabled

Steps

VaishnaviK43271_1-1770099040130.png

 

Mark this as Helpful if it clarifies the issue.
Accept the solution if this answers your question.

Regards,
Vaishnavi
Associate Technical Consultant

 

PoonkodiS
Mega Sage

Hi @sath 

I tried your requirement.But,i am not sure  your requirement details are correct or not you provided.It was worked ,but what do you choose on the record in sc_task table

PoonkodiS_0-1770122126393.png

If it is not not your expectation ,can you provide the details more.

 

Regards,

poonkodi

Ankur Bawiskar
Tera Patron

@sath 

there is no direct action that updates the variables in flow designer and also it is not recommended also. But you can achieve it through the following steps - 

  1. Look up record on the sc_item_option_mtom table where 'Parent Item' is 'RITM' and 'Dependent Item.Question.Name' is 'variable name' (which variable's value you need to change) AnkurBawiskar_0-1770122519464.png

     

  2. Then look up record -  'sc_item_option' with conditions - 'sys_id' = 'Dependent Item.sys_id' (the first look up record's)  

AnkurBawiskar_5-1770122588933.png

 

3. Then Update the last look up record with desire value change - AnkurBawiskar_2-1770122519471.png

 

 

💡 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