Data Directive Email Data Query

I have a standard Data Directive setup that sends an email. I want to query data from another table to insert into the email. How can i do this?

Thanks!

I do this by querying data within the C# code condition (The personalize Condition xxxx is Valid ), then fill in the CallcontextBPMdata fields needed and use those fields into the email.

For instance, I want to use the full name of a Requestor, and it’s email in maintenance Request approval…to send him result (approved or not via email…)

string currentuser = 	 callContextClient.CurrentUserId.ToString();			
var userRow = (from userCreate in Db.UserFile where((userCreate.DcdUserID == reqRow.Requestor) || (userCreate.DcdUserID == currentuser )) select userCreate);

							
foreach (var uRow in userRow)
{
		
		if(uRow.DcdUserID == reqRow.Requestor)
		{
				callContextBpmData.Character01 = uRow.Name;
				if(uRow.EMailAddress.ToString().Length > 0 )
						callContextBpmData.Character02 = uRow.EMailAddress;
				else 
						callContextBpmData.Character02 = "Myself@MyCompany.com";//avoid a futur pitfall ...
						
				result = true;										 
		}
		if ( uRow.DcdUserID == callContextClient.CurrentUserId )
		{
				callContextBpmData.Character03 = uRow.Name;
				
		}
		callContextBpmData.Character04 = string.Format("{0: dd/MM/yyyy}", reqRow.RequestDt);
		
}

Then in the emial I use the Call context data…

Pierre

2 Likes