# Display custom message when Perspective Table has no data

**URL:** <https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 29, 2021, 1:20pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499 "2021-10-29T13:20:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [October 29, 2021, 1:20pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/1 "2021-10-29T13:20:01Z")

</div>

I want to display a message when no data on table, something like below but it’s not working, plz let me know how to mention for table if nodata

```auto
if (LotId!="" or MatlAutoId!=None) and vtable==dataset[0x6]:
		self.props.emptyMessage.noData.text="No Data Found"
		self.props.emptyMessage.noData.icon.path=material/sentiment_very_dissatisfied
	else:
		pass

```

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 29, 2021, 1:35pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/3 "2021-10-29T13:35:53Z")

</div>

> [@Clearing a dataset?](https://forum.inductiveautomation.com/t/clearing-a-dataset/6354/9):
>
> `vtable==dataset[0x6]`

You cannot do this. If vtable is a dataset, you could do `vtable.rowCount == 0`

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 29, 2021, 1:36pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/4 "2021-10-29T13:36:45Z")

</div>

You’ve posted the same question in multiple topics. Don’t do this. And this one dates back to well before Perspective existed. ):

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [October 29, 2021, 1:47pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/5 "2021-10-29T13:47:35Z")

</div>

I am sorry for that…I searched for the ans but not found anywhere so asked in other 3 places for help …I will not do this for next time .

@bkarabinchak.psi Thank you for your reply

I deleted my question from other 2 places 😅 🙂

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 29, 2021, 2:27pm UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/6 "2021-10-29T14:27:49Z")

</div>

This should probably be in its own topic as it doesn’t really fit the OP, if an admin can split it for us. 🙂

Why does it need to be scripted, instead of just setting those two properties and be done?

EDIT: nvm, I just saw the new thread. I’ll continue over there.

---

<div class="post-metadata">

**Author:** ![manjuyadav95.m](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@manjuyadav95.m](https://forum.inductiveautomation.com/u/manjuyadav95.m)\
**Post date:** [October 30, 2021, 7:14am UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/7 "2021-10-30T07:14:11Z")

</div>

Thanks for your Reply!  
By using noData prop, i can display the msg and icon as below: lot no. and matl name not entered here but the message still shows but it shouldn’t b

but I want to display the message only when lot no. or matl name is entered coz table data displays based on lot no./matl name so where I can trigger to perform that function ?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 30, 2021, 9:54am UTC](https://forum.inductiveautomation.com/t/display-custom-message-when-perspective-table-has-no-data/52499/8 "2021-10-30T09:54:25Z")

</div>

I would make a few custom properties on the table and bind with expressions.

- an array with the different noData values you want. The attached examples has an extra one to remind the user to enter Lot and material. I copied and pasted it from the props section. 😉

- a value of the data row count  
`len({this.props.data})`

- an index to pick which noData value you want to use (In my example I also added custom properties for lot and material, but you can bind those to where you enter them.

```auto
if({this.custom.MatlAutoId} = '' || {this.custom.LotId} = '', 
   2,
   if({this.custom.rowCount} = 0, 1,
      0
     ) 
  )

```

Then you can bind props.emptyMessage.noData to your custom message  
`property('this.custom.noDataMessages[' + {this.custom.noDataIndex} + '].noData')`

[test\_table.zip](https://forum.inductiveautomation.com/uploads/short-url/mRcVji63vEPut2XtwWjXXeKNBJ4.zip) (18.8 KB)
