This forum allows users to post and respond to "How Do I Do ....." questions. The information contained in this forum has not been validated by K-Rise Systems and, as such, K-Rise Systems cannot guarantee the accuracy of the information.
maschuster
Posts: 2 Joined: May 26th, 2023, 8:11 am
Contact:
Unread post
by maschuster » May 9th, 2024, 1:18 pm
When outputting a JSON array the first element is always
Code: Select all
"Result": [
{
"@SelectOutput": "False"
},
Can this be suppressed from the output?
Code: Select all
<RESTOutput>
<Output>
<Output>
<Status>Good</Status>
<Total>
<xsl:value-of select="WorkData/GetUsers/Info/Result/NoOfRecords"/>
</Total>
<xsl:copy-of select="WorkData/GetUserDetails/Output/Result"/>
</Output>
</Output>
</RESTOutput>
Code: Select all
{
"Output": {
"Status": "Good",
"Total": "23618",
"Result": [
{
"@SelectOutput": "False"
},
word count: 65
SteveCap
Posts: 329 Joined: August 26th, 2021, 9:18 am
Contact:
Unread post
by SteveCap » May 10th, 2024, 3:11 pm
To remove the @SelectOutput from the output you can change you RESTOutput service to be:
Code: Select all
<RESTOutput>
<Output>
<Output>
<Status>Good</Status>
<Total>
<xsl:value-of select="WorkData/GetUsers/Info/Result/NoOfRecords"/>
</Total>
<xsl:for-each select="WorkData/GetUserDetails/Output/Result">
<Result>
<xsl:copy-of select="*"/>
</Result>
</xsl:for-each>
</Output>
</Output>
</RESTOutput>
word count: 55