Skip to main content

When conditional rendering based on model property number of rows is applied to a component, the rendered result is incorrect.


This appears to be a regression of https://community.skuid.com/t/conditional-rendering-model-property-number-of-rows-issu…


Steps to Reproduce:


  1. Create Page using sample xml below

  2. Preview page picking account

Expected Result

Templates “Show if RowCount > 0”, “Show if RowCount >= 1”,“Show if RowCount == 1” are displayed


Actual Result

Template “Show if RowCount != 1” is displayed


Note - The sample page below works as expected on 6.8.20


Sample Page XML


<skuidpage unsavedchangeswarning="yes" showsidebar="true" showheader="true" tabtooverride="Account" personalizationmode="server">   <models>      <model id="Account" limit="1" query="true" createrowifnonefound="false" sobject="Account">
<fields>
<field id="Name"/>
<field id="CreatedDate"/>
</fields>
<conditions>
<condition type="param" enclosevalueinquotes="true" operator="=" field="Id" value="id"/>
</conditions>
<actions/>
</model>
</models>
<components>
<pagetitle model="Account" uniqueid="sk-3Zk7mZ-58">
<maintitle>
<template>{{Name}}</template>
</maintitle>
<subtitle>
<template>{{Model&#46;label}}</template>
</subtitle>
<actions/>
</pagetitle>
<template multiple="false" uniqueid="sk-3ZkHGo-82" model="Account">
<contents>Show if RowCount &amp;gt; 0</contents>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data&#46;length" operator="gt" value="0"/>
</renderconditions>
</template>
<template multiple="false" uniqueid="sk-3ZkdpN-129" model="Account">
<contents>Show if RowCount &amp;gt;= 1</contents>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data&#46;length" operator="gte" value="1"/>
</renderconditions>
</template>
<template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-59">
<contents>Show if RowCount == 1</contents>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="=" enclosevalueinquotes="false" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data&#46;length" value="1"/>
</renderconditions>
</template>
<template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-60">
<contents>Show if RowCount != 1</contents>
<renderconditions logictype="and">
<rendercondition type="fieldvalue" operator="!=" enclosevalueinquotes="true" fieldmodel="Account" sourcetype="modelproperty" nosourcerowbehavior="deactivate" sourceproperty="data&#46;length" value="1"/>
</renderconditions>
</template>
<template multiple="false" model="Account" uniqueid="sk-3Zk7mZ-61">
<contents>Row Count = {{$Model&#46;Account&#46;data&#46;length}}</contents>
</template>
</components>
<resources>
<labels/>
<css/>
<javascript/>
</resources>
<styles>
<styleitem type="background" bgtype="none"/>
</styles>
</skuidpage>

Thanks Barry - we had identified this issue a week or so ago.  Its on our list. 


This will be fixed in Banzai Update 2. The problem was actually unrelated to the issue previously posted — we introduced some enhancements around the ability to navigate into Array data via skuid.utils.getObjectProperty() that were necessary for External Data support that were the root cause of the issue here (probably TMI, but I figured Barry you’d appreciate it 🙂


You know me well, definitely appreciated 🙂  Thanks Zach!


Tested and confirmed as resolved in Skuid 7.16.  Thank you!


Reply