How to send inputs from UI action to a flow designer?

Vasu20
Tera Contributor

Scenario: I need to pass input values from a ui action to a flow designer and based on those input values i need to continue my flow in the flow designer.

 

Any guidance is appreciated.

Thanks and Regards,

Vasu

1 ACCEPTED SOLUTION

Hi,

please share the setup

check this

https://community.servicenow.com/community?id=community_question&sys_id=e16969e81b50b8d0d46b62c4bd4b...

Regards
Ankur

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you can make UI action as server side and send values to flow as inputs

I assume your flow is also on same table where UI action is defined.

Scripting with Flows, Subflows, and Actions

(function() {

	try {
		var rec_id = current.sys_id;
		var gr = new GlideRecord(current.getTableName());
		if (gr.get(rec_id)) {
			var inputs = {};
			inputs['current'] = current; // GlideRecord of table: 
			inputs['table_name'] = current.getTableName();
			inputs['email'] = 'your email'; // input to flow

			// Start Asynchronously: Uncomment to run in background.
			// sn_fd.FlowAPI.startFlow('flow name', inputs);

			// Execute Synchronously: Run in foreground.
			sn_fd.FlowAPI.executeFlow('flow name', inputs);
		}
	} catch (ex) {
		var message = ex.getMessage();
		gs.error(message);
	}

})();

Regards
Ankur

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

Thank you so much, this is helpful. How can i receive these input values in the flow designer?

 

Best Regards,

Vasu

Hi,

you can create flow variable with that name and use it

https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/administer/flow-designer/task/cre...

Regards
Ankur

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

Thank you so much again .The flow variable is taking values through the course of the flow but not the values passed from the ui action.Can you please help out?