There are many ways to return multiple values from a cfc. Typically we return a query object, a json string, an array, or a structure, but one of my favorite ways to return multiple bits of data is using a shorthand structure. It is much easier and intuitive to use on both the back and front end than using an array. Here is a simple example:

Cfc:

view plain about
1<!--- There are two types of routing titles. The original design used an routing title that was used to populate a contract and this title was not the official title, but something more generic that was easily identifiable on a written contract. The other title is the official title that is coming from the workday database We will use the original routing title if the user was assigned a routing title that is found in the routing database, otherwise, we will use the official workday title. --->
2 <cffunction name="getTitleByEmail" access="remote" returntype="struct" hint="Determines the approver title. This will be either the routing title that was used in previous contracts, or the official title found in workday. We need to return multiple values, so this returns a one dimension array instead of a string.">
3 <cfargument name="email" type="string" required="yes" hint="Supply the email.">
4
5 <cfparam name="title" default="">
6
7 <!---Format the email--->
8 <cfinvoke component="#WorkdayUsersObj#" method="formatUwEmail" returnvariable="uwEmail">
9     <cfinvokeargument name="email" value="#arguments.email#">
10        </cfinvoke>
11
12 <!--- Query the Approval database to see if the title exists. --->
13 <cfquery name="approvalTitle" datasource="Contracts">
14     SELECT TOP (1)
15                ApproverTitle
16                FROM dbo.Approval
17                WHERE (Email = <cfqueryparam value="#uwEmail#" cfsqltype="cf_sql_varchar">)
18 </cfquery>
19 <!---Set the ApproverTitle--->
20 <cfset ApproverTitle = approvalTitle.ApproverTitle>
21         <!---Get the workday job title. --->
22         <cfinvoke component="#WorkdayUsersObj#" method="getEmployeeJobTitle" returnvariable="workdayTitle">
23            <cfinvokeargument name="email" value="#email#">
24         </cfinvoke>
25
26 <!---Build the shorthand struct --->
27 <cfset titleStruct = {workdayTitle = #workdayTitle#, ApproverTitle = #ApproverTitle#}>
28
29 <cfreturn titleStruct>
30
31 </cffunction>

On the client side, simply use the following to output the value:

view plain about
1<cfset thisRoutingTitle = getTitleByEmail(thisApproverEmail).ApproverTitle>
2<cfset thisWorkdayTitle = getTitleByEmail(thisApproverEmail).WorkdayTitle>