In an effort to increase our online presence we decided to create a prayer wall. We wanted a way for people to be able to indicate that they had prayed and also make it available to the general public. There are still some improvements we want to make, but we wanted to get it up soon. Eventually we want people to receive an email or text when their request is prayed for. I'll update this when we complete that.


Lava Webhook

First we need to create a lava webhook that will allow someone to click the button "I prayed for this" and update the "PrayerCount" column in the database. 

  1. Navigate to Admin Tools --> General Settings --> Defined Types and find Lava Webhook
  2. Create a new Lava Webhook with the following settings:
  3. Template Code

  4. {% sql statement:'command' %}
            PrayerCount = CASE WHEN PrayerCount IS NULL THEN 1 ELSE PrayerCount + 1 END
            Guid = '{{ QueryString.Prayer | SanitizeSql }}'
        {% endsql %}
        {% prayerrequest where:'Guid == "{{ QueryString.Prayer | SanitizeSql }}"' %}
            {{ prayerrequest.PrayerCount }}
        {% endprayerrequest %}
        {% comment %}
        <!--Eventually this will be how we text / email someone when a request is prayed for -->
        {% workflowactivate workflowtype:'999' PrayerGuid:'{{ QueryString.Prayer }}' %}
        {% endworkflowactivate %}
        {% endcomment %}

Prayer Wall Page

Next you need to create a page for the Prayer Wall. There will be 3 blocks on this page: HTML Content, Prayer Request Entry, and Prayer Request List Lava.

  1. Once you have the blocks on the page, add some html to your HTML Content block for a title and maybe some information about the page. Below is an example
    <div class="col-xs-12 text-center">
          <h1 class="bold">Prayer Wall</h1>
          <h4>How can we pray for you? Share your prayer request (and read and pray for other requests) below.</h4>
  2. Set the appropriate settings on the Prayer Request Entry block for your Church. On the advanced settings tab, add the following code into the Pre and Post HTML spots.
    <div class="row" style="padding-bottom:40px;">
          <div class="col-xs-12">
              <a class="btn btn-primary" data-toggle="collapse" href="#prayer-request-entry" role="button" aria-expanded="false" aria-controls="prayer-request-entry">Share Your Prayer Request</a>
          <div class="collapse col-xs-12 panel panel-default" id="prayer-request-entry">
          <div class="panel-body">
  3. Post-HTML:
  4. Lastly we will edit the Prayer Request List Lava block. Be sure to set the settings appropriately. Don't forget to choose the proper category.
    {% for pr in PrayerRequestItems %}
        {% if pr.IsPublic %}
        <div class="panel panel-default prayer">
            <div class="panel-body">
                <div class="col-md-8 col-xs-6">
                    <h3>{{ pr.FirstName }}</h3>
                <div class="col-md-4 col-xs-6">
                    <button class="btn btn-primary pull-right btn-click-action" data-id="{{ pr.Guid }}">I prayed for this</button>
                    Prayed for <span id="prayerCount-{{ pr.Guid }}" class="badge bg-primary">{{ pr.PrayerCount | Default:'0' }}</span> times
                <div class="clearfix visible-xs-block"></div>
                <div class="col-md-12 col-xs-12"><p>{{ pr.Text }}</p></div>
                <div class="col-md-12 col-xs-12"><p>{{ pr.EnteredDateTime | Date:'M/d/yyyy'}}</p></div>
        {% endif %}
    {% endfor %}
        var btnClassClick = function(e){
            var guid = $(this).data("id");
            //console.log("The data-id of clicked item is: " + guid);
            $.ajax ({
                type: "GET",
                url: "/Webhooks/Lava.ashx/PrayerUpdate?Prayer=" + guid,
                success: function(prayerCount) {
                    //console.log('Count increased to: ' + prayerCount);
            $(this).text('Thanks for Praying!');
            $(this).prop('disabled', true);
        $(".btn-click-action").on("click", btnClassClick);

Additional Steps

That's it! Please look for more to be added soon, with the ability to text / email those who have been prayed for.