<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[West Des Moines Community Schools Technology]]></provider_name><provider_url><![CDATA[https://wdmtech.wordpress.com]]></provider_url><author_name><![CDATA[Brian Abeling]]></author_name><author_url><![CDATA[https://wdmtech.wordpress.com/author/wdmtech/]]></author_url><title><![CDATA[Automating Tasks in Infinite&nbsp;Campus]]></title><type><![CDATA[link]]></type><html><![CDATA[<p>I recently presented &#8220;Automating Tasks in Infinite Camps at the ITEC IT Conference to share with other districts how the Task Scheduler tool within Campus can be used to automate rules and processes such as student flags.  The following post is to share the slides and the examples with other districts.</p>
<p>My favorite techie feature inside Infinite Campus is, without a doubt, the Task Scheduler. Although it&#8217;s buried in System Admin&gt;Preferences section, it&#8217;s easily the most useful tool for automating tasks within Infinite Campus.  Basically, the task scheduler lets you insert SQL programming code into the system and set it to run on a schedule (daily, weekly, or manual). In West Des Moines Schools, we use the task scheduler to automate the creation of several student flags, as well as to mark/populate certain data fields based on other fields.</p>
<p><span style="line-height:1.714285714;font-size:1rem;">A few notes of caution:</span></p>
<p>1) I am not a SQL programmer, I did not generate the programming for these examples, instead I&#8217;m the idea guy&#8230;  I dream up ways we can use the task scheduler to automate various features within Campus. Credit for the scripting goes to our Campus Guru, Susan Tiemens.</p>
<p>2) Using these scripts can be dangerous to your system &#8211; once they are run, there is no &#8216;undo&#8217;, so you must be sure that the script is modified for your system needs.</p>
<p>April 2017 presentation:</p>
<div class="embed-slideshare"><iframe src="https://www.slideshare.net/slideshow/embed_code/key/tbKVK1YMCvfk0o" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> </p>
<div style="margin-bottom:5px"> <strong> <a href="https://www.slideshare.net/BrianAbeling/my-favorite-sql-scripts" title="My favorite sql scripts" target="_blank">My favorite sql scripts</a> </strong> from <strong><a target="_blank" href="http://www.slideshare.net/BrianAbeling">Brian Abeling</a></strong> </div>
</div>
<p>&nbsp;</p>
<p>.</p>
<p>.</p>
<p>Original Presentation:</p>
<iframe src='https://www.slideshare.net/slideshow/embed_code/17466688' width='425' height='348' sandbox="allow-popups allow-scripts allow-same-origin allow-presentation" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe>
<p>Here&#8217;s some of the specific examples and scripts&#8230;.</p>
<h3>Delete Inbox Messages&#8230;&#8230;..</h3>
<p>By default, all messages in the inbox stay forever.  Since these messages are already sent to parents by email, we encourage them to keep them in their email if they choose to archive the messages.  We use this script in the task scheduler to automatically remove all messages older than 5 days (or adjust the 5 to the number of days you&#8217;d like)</p>
<p><em>delete pm</em><br />
<em>from processMessage pm</em><br />
<em>where pm.postedTimestamp&lt;= (select getDate() -5 days)</em></p>
<h3>Turn off class rank&#8230;..</h3>
<p>Our district doesn&#8217;t use class rank, so we use a task scheduler script to automatically turn off class rank and its runs daily to make sure that class rank is always off for all student records.</p>
<p><em>UPDATE Enrollment SET classRankExclude = 1 WHERE classRankExclude = 0</em></p>
<h3>Force Password Change</h3>
<p>We use this script to ensure that certain, common passwords are never used to help ensure security. When run, if this scripts finds one of these passwords, it automatically marks force password change for that use.   In the area where &#8216;happy123&#8217; is, you would change this area to reflect the specific passwords that you would like not to be used.</p>
<p><em>update UserAccount</em><br />
<em>set forcechangepassword = 1</em><br />
<em>WHERE UserAccount.password IN (&#8216;happy123&#8242;,&#8217;Happy123&#8242;,&#8217;HAPPY123&#8242;,&#8217;happyface123&#8242;,&#8217;Happyface123&#8242;,&#8217;HAPPYFACE123&#8242;,&#8217;HappyFace123&#8242;,&#8217;dietcoke2&#8242;,&#8217;dietcoke3&#8242;,&#8217;dietcoke4&#8242;,&#8217;12345&#8242;,&#8217;123456&#8217;)</em></p>
<h3>Delete all social security information</h3>
<p>Although there is a field for social security numbers within Campus, our districts&#8217;s policy is that we NEVER ask for or store social security numbers.  To help ensure that this happens, we have a script that runs nightly and deletes anything that is stored in these fields &#8211; helping to ensure that nothing is recorded.</p>
<p><em>UPDATE student</em><br />
<em>SET student.SSN=Null</em><br />
<em>WHERE student.SSN is not null</em></p>
<p><em>UPDATE staffmember</em><br />
<em>SET staffmember.SSN=Null</em><br />
<em>WHERE staffmember.SSN is not null</em></p>
<p><strong>Mark Guardians for portal and messenger access</strong></p>
<p>To ensure that all guardians in the system automatically receive port and messenger access and are never accidently missed, we use the following nightly script. (Keep in mind, parents can still opt out of getting message with their own personal preferences &#8211; but this ensure that we aren&#8217;t causing the issue in their preferences)</p>
<p><em>UPDATE RelatedPair</em><br />
<em>SET messenger= 1, portal=1 </em><br />
<em>From RelatedPair</em><br />
<em>WHERE relatedpair.guardian=1 and relatedpair.enddate is null</em></p>
<h3>Mark ELP flag</h3>
<p>This style of script is used for multiple scenarios for us, all involving marking or flaging students who specific designations or needs.  In this example, we use the state reporting field for talented and gifted to produce a special visual flag for staff.  In this example, the referenece to programID=81 is the reference to our ELP flag, which is number 81 in our system.  This would need to be altered to system ID for the ELP flag that your system has.</p>
<p><em>/*Remove All Gifted/Talented Flags*/</em><br />
<em>DELETE from ProgramParticipation </em><br />
<em>from ProgramParticipation </em><br />
<em>WHERE ProgramParticipation.programID=81</em></p>
<p><em>/*Insert ELP (Gifted/Talented) Program Flag on Students who are marked for Gifted/Talented*/</em><br />
<em>INSERT INTO ProgramParticipation (programID, personID, districtID, startDate)</em><br />
<em>SELECT p.programID, e.personID, e.districtID, CONVERT(SMALLDATETIME, FLOOR(CONVERT(FLOAT, GETDATE()))) startDate</em><br />
<em>FROM Program p</em><br />
<em>INNER JOIN SchoolYear sy ON sy.active = 1</em><br />
<em>INNER JOIN Enrollment e ON e.endYear = sy.endYear</em><br />
<em>INNER JOIN Student s on s.personID=e.personID</em><br />
<em>LEFT OUTER JOIN ProgramParticipation pp ON pp.personID = e.personID</em><br />
<em> AND pp.programID = p.programID AND (pp.endDate IS NULL</em><br />
<em> OR pp.endDate &gt; FLOOR(CONVERT(FLOAT, GETDATE())))</em></p>
<p><em>WHERE pp.participationID IS NULL and sy.active = 1</em><br />
<em>AND s.endDate Is Null and s.activeyear=1 and s.servicetype=&#8217;P&#8217;</em><br />
<em>AND p.programid=81 and e.giftedTalented=&#8217;1&#8242;</em><br />
<em>GROUP BY p.programID, e.personID, e.districtID</em></p>
<h3><em>Messenger Teacher Box</em></h3>
<p>We automatically set the preference that allows Teachers to use Messenger to send notifications to parents.</p>
<p><em>/* This turns on the Teacher box for a Guardian with Messenger Access in the Messenger Preferences on their Census/Demographics Tab*/</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 8 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 0 or contact.emailmessenger is null</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 9 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 1</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 10 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 2</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 11 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 3</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 12 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 4</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 13 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 5</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 14 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 6</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 15 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 7</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 24 </em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 16</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 25</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 17</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 26</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 18</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 27</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 19</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 28</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 20</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 29</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 21</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 30</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 22</em></p>
<p><em>UPDATE Contact </em><br />
<em>SET contact.emailmessenger = 31</em><br />
<em>From Contact </em><br />
<em>INNER JOIN v_CensusContactSummary ccs ON contact.personID=ccs.contactPersonID</em><br />
<em>WHERE ccs.guardian=1 and ccs.messenger=1 and contact.emailmessenger = 23</em></p>
<p>&nbsp;</p>
<h2>Mark IEP Flags</h2>
<p><em>/*Clear ALL SPED Program Flags out*/</em><br />
<em>DELETE from ProgramParticipation </em><br />
<em>from ProgramParticipation </em><br />
<em>WHERE ProgramParticipation.programID=10</em></p>
<p><em>/*Insert SPED Program Flag on Studentsmarked for SPED*/</em><br />
<em>INSERT INTO ProgramParticipation (programID, personID, districtID, startDate)</em></p>
<p><em>SELECT p.programID, e.personID, e.districtID,</em><br />
<em> CONVERT(SMALLDATETIME, FLOOR(CONVERT(FLOAT, GETDATE()))) startDate</em><br />
<em>FROM Program p</em><br />
<em>INNER JOIN SchoolYear sy ON sy.active = 1</em><br />
<em>INNER JOIN Enrollment E on sy.endYear=e.endyear and E.SpecialEdstatus=3</em><br />
<em>LEFT OUTER JOIN ProgramParticipation pp</em><br />
<em> ON pp.personID = e.personID AND pp.programID = p.programID</em><br />
<em> AND (pp.endDate IS NULL OR pp.endDate &gt; FLOOR(CONVERT(FLOAT, GETDATE())))</em><br />
<em> WHERE pp.PersonID IS NULL and e.enddate is Null and p.programID=10</em><br />
<em> Order by e.personID, p.programID</em></p>
]]></html></oembed>