0

I have made a satisfaction survey in SharePoint 2013.

I am asked to get automatic email send every week with graphical summary.

Is it possible ? should I use workflow option ?

Asad Refai
  • 5,971
  • 8
  • 34
  • 57
Adam Miklaszewski
  • 219
  • 1
  • 2
  • 14

1 Answers1

0

Yes, SP Designer Workflow can be easily created for the survey list and add the add Action[send email] on every week.
To calculate everyweek functionality you can create a calculated column which calculates every Friday/end of the week from the date of survey creation and access this value inside your SP D workflow and trigger accordingly.

Second approach is that, you can create a SP Timer job which monitors this survey list and compare the today's date with the survey creation date and check the weekend/[friday/saturday] and configure to run this on every night 12 AM. ANDREW-CONNEL has given a detailed explanation about sp timer jobs.

Below is the working code for creating google chart against a SPList I have created.It displays line chart. you can draw pie chart/bar chart based on your requirement:

  <script language="javascript" src="/project/SiteAssets/jquery-
  1.8.2.min.js" type="text/javascript"></script>
    <script language="javascript" 
       src="/project/SiteAssets/jquery.SPServices-
      0.7.2.min.js" type="text/javascript">
    </script>
        <script type="text/javascript"  
      src="https://www.google.com/jsapi?autoload={  
        'modules':[{  
          'name':'visualization',  
          'version':'1',  
          'packages':['corechart']  
        }]  
      }"></script>  

<script type="text/javascript">  
  google.setOnLoadCallback(drawChart);  
  function drawChart() {  

               //alert('inside drawchart');
        var SalesData = GetMySalesData();  
        var optionsSalesData   = {  
        title: 'sales Chart',  
        vAxis: {  
                viewWindow: {min: -1},  
                title: "sales Chart", 
                displayAnnotations: true  
                },  
         hAxis: {  
                title: "columnNVSMonths"                
        },  
        pointSize: 5,  

        legend: { position: 'right' }  
        };  

                                            //alert('b4 calling chartsales');
        var chartSales = new google.visualization.LineChart(document.getElementById('salesChart'));  
                                            //alert(' chartresources object exists ');
                                            //alert(chartSales);
        chartSales.draw(SalesData, optionsSalesData);     
                                            //alert('drawing completed');
  }  

     function  GetMySalesData()  
     {  
  //alert('get my sales data');
   var data = new google.visualization.DataTable();  
        //data.addColumn('string', 'Year');  
               //var fiscalYear = 
              formatStr($(this).attr("ows_FiscalYear"));
            data.addColumn('string', 'NVSMonthName');  
            //data.addColumn({type: 'datetime', role: 'annotation'});
          data.addColumn('number', 'NVS_Planned');  
          //data.addColumn({type: 'number', role: 'annotation'});  
        alert('b4 calling spservices get list items');
          $().SPServices({  
         operation: "GetListItems",  
             async: false,  
            listName: "salessurveyList",
            CAMLQuery: "<Query><Where><IsNotNull><FieldRef Name='Title'/>
              </IsNotNull></Where></Query>",
            CAMLViewFields: "<ViewFields><FieldRef Name='Title' />
            <FieldRef Name='NVSMonthName' />
            </ViewFields>",  
          CAMLRowLimit: 0,
         completefunc: function (xData, Status) 
            {  
         //var itemCount = 
           $(xData.responseXML).SPFilterNode("z:row").attr("ItemCount");  
      //alert("itemCount :" + "" + itemCount);
               var count = 0;  
                //$(xData.responseXML).find("
               [nodeName='z:row']").each(function()   
              $(xData.responseXML).SPFilterNode("z:row").each(function()   
                {  
              count = count + 1;   
             //console.log(' current count is ..'+ count);
             //alert(xData.responseText);
                //alert(xData.responseXML.xml);
              var titleofresourcelist =  $(this).attr("ows_Title");  
                 var nvsMonthName =  
             $(this).attr("ows_NVSMonthName").split(";#")[1];  
                            //console.log(nvsMonthName);
            var NVSPlanned =  $(this).attr("ows_NVS_Planned");  
           //console.log('adding into data table');
                    data.addRow(["'"+ nvsMonthName +"'"]);   
                 });              }                });  
       return  data;  
         }  
       </script>  
        <div>  
  <div id="SALESChart" style="width:455px;height: 400px;float:left  
       ;margin:0 auto;display:block"></div>  
       </div>  
samolpp2
  • 3,530
  • 5
  • 54
  • 97
  • Thank you, I am doing first steps in the SP Designer and SP. Is there a way to specify or indicate some sources where can I find how to create this specific calculated column for every Friday or Saturday ? And it will send an email with complete graph stats ? – Adam Miklaszewski Feb 17 '16 at 10:19
  • am not sure about how to send the graphical summary.You can create google charts using javascript and google API , this javascript code needs to be added inside the content editor web part OR immediately below sp designer's OR create a js file with the chart/graphical summary code and upload this js file into a SiteAssets library and refer this js file within a content editor web part. – samolpp2 Feb 17 '16 at 10:26
  • pls refer this link for calculated columns : :http://sharepoint.stackexchange.com/questions/74474/get-the-month-from-a-date-column-with-the-calculated-column you can get the dayof the week as well. – samolpp2 Feb 17 '16 at 10:31
  • Lynda has detailed about WF which send email :http://www.lynda.com/SharePoint-tutorials/Creating-workflow-sends-email/144025/161215-4.html About dates in calculated field check here :https://abstractspaces.wordpress.com/2009/05/02/common-date-time-formulas-for-sharepoint-calculated-fields/ – samolpp2 Feb 17 '16 at 10:33
  • Thank you very much ! I'll check it out and keep you inform about evolution. – Adam Miklaszewski Feb 17 '16 at 10:45
  • If its helpful,you can mark its as an answer or mark as helpful post for my answer/replies. – samolpp2 Feb 17 '16 at 10:50