# Need to show embedded view based on the table data in DB

**URL:** <https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 20, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615 "2024-05-20T12:58:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![srinivasan\_s](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@srinivasan\_s](https://forum.inductiveautomation.com/u/srinivasan_s)\
**Post date:** [May 20, 2024, 12:58pm UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/1 "2024-05-20T12:58:25Z")

</div>

Hi all.,  
I have page, that need to add machine details. machine details are recorded in DB. I need to configure the embeeded view based on one condition,  
Condition 1: if table has data it should respective table data in table component[That has separate view]  
Condition 2: if table is empty, it should another view as called "No data to show"  
Attached the picture that should show in embedded view when table is empty!  
kindly help!

 ![Capture1234](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/9/293cd7dba3af017cec33cd1f696caa058c01237f.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 20, 2024, 1:18pm UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/2 "2024-05-20T13:18:46Z")

</div>

- Create a view. I will assume you are using a flex view.
- Add a Table component.
- Set `POSITION.grow : 1`.
- Create a binding on `PROPS.data` to get the information to be displayed.
- Add a Label component.
- Set `POSITION.grow : 1`.
- Set `PROPS.text : No data to show.`

Create a binding on the Table's `POSITION:display`.

![Table display on data](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/7/37388252da08b446907eec40398f884ec5e23ec2.png)

_Figure 1. Table._

Create a similar binding on the Label's `POSITION.display` but set the expression to as follows:

![Label display if data](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/a/9ad4987b1fe8440ad2698d0337bb90f6b586a2de.png)

_Figure 2. Label._

Now the table should display if there is data. The label should display if there is no data.

---

<div class="post-metadata">

**Author:** ![srinivasan\_s](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@srinivasan\_s](https://forum.inductiveautomation.com/u/srinivasan_s)\
**Post date:** [May 20, 2024, 1:38pm UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/3 "2024-05-20T13:38:12Z")

</div>

Thank you for your reply. I will try now!

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 20, 2024, 1:42pm UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/4 "2024-05-20T13:42:44Z")

</div>

There was an error in my Figure 2. I fixed it.

---

<div class="post-metadata">

**Author:** ![srinivasan\_s](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@srinivasan\_s](https://forum.inductiveautomation.com/u/srinivasan_s)\
**Post date:** [May 21, 2024, 6:56am UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/5 "2024-05-21T06:56:57Z")

</div>

executed the same using ignition embedding view.  
Bind the property of "props.path" of embedding view as shown in the figure.  
Note: I am using query tag to get the data for table component.

 ![binding](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/2/e226e7d1df2e42bf9ebdd0d31ccd2e2ab1d34c47.png)

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 21, 2024, 8:35am UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/6 "2024-05-21T08:35:23Z")

</div>

Be careful with your comparison `....value} > '0'`. You are comparing a query tag result (dataset or JSON) with a **string**'0'. This might not work in the way you expect in all cases.

If you are looking for a non-empty string then it should be `....value} > ''` but whether either solution is correct depends on the data type / structure.

---

<div class="post-metadata">

**Author:** ![srinivasan\_s](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@srinivasan\_s](https://forum.inductiveautomation.com/u/srinivasan_s)\
**Post date:** [May 21, 2024, 9:15am UTC](https://forum.inductiveautomation.com/t/need-to-show-embedded-view-based-on-the-table-data-in-db/90615/7 "2024-05-21T09:15:26Z")

</div>

Thank you.Noted
