Run Procedure
Process Steps can run a SQL statement. Enter a complete and valid T-SQL statement in the SQL Statement field. Note that the statement is limited to 1,000 characters.
- dp_RecordID – The ID of the record invoked by workflow.
- dp_UserID – The User record ID of the user set in the step's Task Owner.
- dp_DomainTime – Represents the current time according to the Time Zone set in the Domain record.
For example, let's say you want to create a Milestone record when someone fills out a custom form. You can use a Process with a Run Procedure step to do this! On the Process Step record, the SQL Statement would look like this:
INSERT INTO Participant_Milestones
(Participant_ID
,Milestone_ID
,Date_Accomplished
,Program_ID
,Domain_ID
,Notes)
SELECT
P.Participant_ID
,83
,GETDATE()
,2
,1
,'Completed XYZ Form'
FROM Participants P
WHERE P.Contact_ID =
(SELECT FR.Contact_ID
FROM Form_Responses FR
WHERE FR.Form_Response_ID = dp_RecordID)