Skip to content

Commit 2eb1e24

Browse files
committed
fix attendance query
1 parent 6affe60 commit 2eb1e24

3 files changed

Lines changed: 14 additions & 8 deletions

File tree

PowerShell-PowerSchool.psm1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,15 @@ function Invoke-PowerSchoolRESTMethod {
8080
}
8181

8282
$uri ="$($(Get-Variable -Name 'PowerSchoolURL').value)$($EndpointURL)"
83-
Write-Host $uri
84-
Write-Host $Body
85-
$Response = Invoke-RestMethod -Uri $uri -Method $Method -Headers $headers -Body $Body
83+
if ($Body)
84+
{
85+
$Response = Invoke-RestMethod -Uri $uri -Method $Method -Headers $headers -Body $Body
86+
}
87+
else
88+
{
89+
$Response = Invoke-RestMethod -Uri $uri -Method $Method -Headers $headers
90+
}
91+
8692
$Response
8793
}
8894

@@ -251,7 +257,7 @@ function Execute-PowerSchoolPowerQuery {
251257
param (
252258
$queryName,
253259
$PageNumber=0,
254-
$postBody
260+
$postBody=$null
255261
)
256262
$URL = "/ws/schema/query/$queryName"
257263
$response = Invoke-PowerSchoolRESTMethod -EndpointURL $URL -Method "POST" -PageNumber $PageNumber -Body $postBody

plugin/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
<field table="STUDENTS" field="GuardianEmail" access="ViewOnly" />
3737
<field table="STUDENTS" field="DistrictOfResidence" access="ViewOnly" />
3838
<field table="STUDENTS" field="Middle_Name" access="ViewOnly" />
39+
<field table="STUDENTS" field="LunchStatus" access="ViewOnly" />
3940
<field table="Attendance" field="attendance_codeid" access="ViewOnly"/>
4041
<field table="Attendance" field="StudentID" access="ViewOnly"/>
4142
<field table="Attendance" field="SchoolID" access="ViewOnly"/>

plugin/queries_root/students.named_queries.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
<column column="STUDENTS.LAST_NAME">fatherdayphone</column>
3636
<column>STUDENTS.GuardianEmail</column>
3737
<column column="STUDENTS.LAST_NAME">PA_Partic_Program</column>
38+
<column>STUDENTS.LunchStatus</column>
3839
<column>STUDENTS.DistrictOfResidence</column>
3940
<column>STUDENTS.Middle_Name</column>
4041
</columns>
@@ -73,12 +74,10 @@
7374
ps_customfields.getcf('students',s.id,'fatherdayphone') fatherdayphone,
7475
s.GuardianEmail,
7576
ps_customfields.getcf('students',s.id,'PA_Partic_Program') PA_Partic_Program,
77+
s.LunchStatus,
7678
s.DistrictOfResidence,
7779
s.Middle_Name
78-
79-
80-
81-
80+
8281
from students s
8382
order by s.dcid
8483
]]>

0 commit comments

Comments
 (0)