The CreatorCon Call for Content is officially open! Get started here.

Need Clarification

Abdul
Tera Contributor

I have a requirement where in i need to trigger tasks based on multi row variable set, if there are rows entered, then a task should trigger else it should not how can i do this in workflow?

Please help 

 

thanks 

3 REPLIES 3

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Abdul 

Yes, Doable. I don’t have the exact script handy, but the logic would be like this:

Use the Get Variable action in Flow Designer to check how many entries exist in NRVS. Based on that:

  • If the number of rows is 0, then no task is created.

  • Otherwise, implement logic to create the task.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

M Iftikhar
Giga Sage

@Abdul ,

When a catalog item is submitted:

The MRVS data is stored in the sc_multi_row_question_answer table.

It links to the request item (sc_req_item) through the parent field.

Add a Run Script activity before your “Create Task” activity. 

Create a Decision activity after the script.

Set the condition: proceed == true → path leads to Create Task.

Set the false path → End or next logical step.

 

Check this thread for reference: https://www.servicenow.com/community/developer-forum/how-do-i-get-the-values-of-multi-row-variable-s... 

 

Thanks & Regards,
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.

Thanks & Regards,
Muhammad Iftikhar

If my response helped, please mark it as the accepted solution so others can benefit as well.

Ankur Bawiskar
Tera Patron
Tera Patron

@Abdul 

why not use flow designer for this?

In flow designer check if MRVS has any row and store the flag in flow variable

If flow variable value is TRUE then iterate that MRVS and create those many tasks

If flow variable value is FALSE then don't create

see this gif on how to do this in flow

AnkurBawiskar_0-1759921492131.gif

 

if you want to use Workflow then check this link has approach, enhance it

MRV to Create a new Catalog task for each row  -> response from James

AnkurBawiskar_1-1759921557359.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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