Question

Photo of Jeremy Turgeon

0

Passing Values Through Workflow Triggers

Is it possible to pass data through a triggered workflow?  For example, if we want an email to be sent every time a new prayer request is entered can that workflow access the prayer request's category, text or initiator?

  • Photo of Nick Airdo

    0

    I needed something similar for a task I'm working on here at Central Christian Church. As Trey mentions, basically I created a Prayer Request Trigger Workflow (see below) and then I set a Workflow Trigger (Admin Tools > General Settings > Workflow Triggers) for the Prayer Request entity type and a Post-Save trigger type.

    The first trick is using the Set Attribute To Entity action. That gets the Guid of the prayer request that was just saved. The second trick was using that attribute in the Run SQL action in order to get and set the Prayer Request Category attribute.

    This is not the only way to do this, just a way that seemed ok to me.

    PrayerRequestTriggerWorkflow.png

    • Nick Airdo

      Forgot to mention... I was only able to get this to work with Rock McKinley 2.0 (currently in alpha as of this writing).

    • Don Smallman

      Nick. Will this work with the new Group requests? I would like to send an email with info pertaining to the person and the group they registered for. I got the email part to work. Now just trying to figure out how to include some useful information.

  • Photo of Trey Hendon III

    0

    I think David's deep dive into Workflows might help. If I understand your question correctly, then the short answer is yes. The "how" gets explained through the HR Example Workflow. http://www.rockrms.com/page/513?Item=78
    • Jeremy Turgeon

      The Advanced Workflows tutorial covers a normal workflow that is user initiated. I'm trying to figure out a way to pass this information through Workflow Triggers. These are under Admin Tools > General Settings > Workflow Triggers and are activated when a specific event occurs (new prayer entered in my example). Thanks for you help though, Trey. :)

  • Photo of Brad Kemp

    0

    Hi,

    How can I get the actual content of the prayer request to be in the email? All I get in the email is the following:
    Prayer Request = 3d3f9d4a-6fe8-4614-a622-47134aa374b6

    Prayer Request Category = Suicidal Tendencies

    We were hoping the email would go to the prayer team with the actual prayer request - ie, "please pray that my family......."

    THANKS!

    • Nick Airdo

      If you set up another Text attribute you can use the RunSQL action to get the prayer request's text via:
      SELECT [TEXT] FROM [PrayerRequest] WHERE [Guid] = '{{ Workflow.PrayerRequest }}'

  • Photo of Brad Kemp

    0

    download.png

    download (1).png

    Nick,

    I tried and don't seem to grasp what you mean. Can you be a little more specific with a new guy like me? :)

    • Nick Airdo

      Your screenshot looks good. Is it working for new requests coming in? If so, your new attribute Prayer Request Text should be getting the results from that action when it runs. If it's not working make sure that new action is running (check the WF log) and/or it could be the
      {{ Workflow.PrayerRequest }}reference -- so you might need to change it to
      { Workflow | Attribute:'PrayerRequest','RawValue'}}


      or the format used shown in the Workflow Actions guide over at https://www.rockrms.com/WorkflowActionCategory?Category=1 ({{ Workflow.PrayerRequest_unformatted }})