New action to get variables from record producer on custom table

Moedeb
Tera Guru

I have a new scoped app, with a table that has been created called "x_br_test_applica_0_table1" (it is not extended from Task at all)

 

Then I have created a record producer on that table. 

 

The issue I have is getting the variables in a flow action so I can use data pills to assign values.

 

Anyone able to assist please?

7 REPLIES 7

Ankur Bawiskar
Tera Patron

@Moedeb 

share some screenshots how flow is configured and trigger etc

💡 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

Ankur Bawiskar
Tera Patron

@Moedeb 

I am able to get that

My flow triggers on that custom table record insert

AnkurBawiskar_0-1768201162588.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

@Ankur Bawiskar  thank you for your reply, however as mentioned by @Kunal Khatri in this thread, I can absolutely see the variable data pills when I use the "Get catalog variables" however when the flow executes it does not pull in the variable values.

 

I looked at the script in the action and can see that it is accessing the variables at the sc_cat_item table, so can see why it doesn't get the values, but I am not skilled enough to adapt the script to work from my custom table.

Kunal Khatri
Tera Contributor

@Moedeb What you are encountering is expected. 

 


The "Get Catalog Variables" action is designed to work with sc_req_item or any table which is extended from 'Task' table.

 

KunalKhatri_0-1768203495367.png

 

Despite the fact, flow designer will show the names of variables, it's values will never be pulled.

If you open execution details of the flow run, you will find warnings in logs.

KunalKhatri_1-1768203563790.png

 

So, in my opinion, you have two options: 

  1.  Map variables values to fields on this custom table, and then use field values
  2.  Write a custom action that would query the variable values from "question_answer" table

 

For second option, ServiceNow stores all values from Record Producer variable to a table named "question_answer" [ instance.service-now.com/question_answer_list.do ].

You will have to query the table for record sys_id and variable name.

 

KunalKhatri_2-1768203705273.png

You can write a custom action to retrieve these values and then use them in the Flow.

I've created a small video to show how to create a Custom Action for this.

 

---------------------------

If you think my response helped you, please mark it as solved.

 

Kunal

loop91