# If condition to check number of rows without using Load RDS Data component

**URL:** <https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508>\
**Category:** Matillion ETL\
**Created:** [January 14, 2025, 8:41am UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508 "2025-01-14T08:41:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farid.srouji](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/farid.srouji/32/1136_2.png) [@farid.srouji](https://matillioncommunity.discourse.group/u/farid.srouji)\
**Post date:** [January 14, 2025, 8:41am UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508/1 "2025-01-14T08:41:12Z")

</div>

We would like to do a check if the table is empty (number of rows is 0) then load into it, otherwise, if the table contains data, then do not load into it.

How can we set a row count without using RDS Query?

&nbsp;

---

<div class="post-metadata">

**Author:** ![HariRamK](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/hariramk/32/855_2.png) [@HariRamK](https://matillioncommunity.discourse.group/u/HariRamK)\
**Post date:** [January 28, 2025, 6:20am UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508/2 "2025-01-28T06:20:47Z")

</div>

Hi [@farid.srouji](https://matillioncommunity.discourse.group/u/farid.srouji)​ you can use python script and update variable to check the table count. Then with help variable you can use it in if component and create a flow. If you need help with python script I can provide it.

---

<div class="post-metadata">

**Author:** ![farid.srouji](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/farid.srouji/32/1136_2.png) [@farid.srouji](https://matillioncommunity.discourse.group/u/farid.srouji)\
**Post date:** [January 28, 2025, 1:14pm UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508/3 "2025-01-28T13:14:35Z")

</div>

Hi,

1. Thank you for your advice.
2. We solve this using Query Result To Scala.
3. Python in Matillion is different, do you have such suggestion?

Thank you.

---

<div class="post-metadata">

**Author:** ![HariRamK](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/hariramk/32/855_2.png) [@HariRamK](https://matillioncommunity.discourse.group/u/HariRamK)\
**Post date:** [January 28, 2025, 2:01pm UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508/4 "2025-01-28T14:01:42Z")

</div>

Yeah, using python in matillion make many things simple for sending mail with file from s3 like that.

&nbsp;

---

<div class="post-metadata">

**Author:** ![HariRamK](https://sea2.discourse-cdn.com/flex002/user_avatar/matillioncommunity.discourse.group/hariramk/32/855_2.png) [@HariRamK](https://matillioncommunity.discourse.group/u/HariRamK)\
**Post date:** [January 28, 2025, 2:02pm UTC](https://matillioncommunity.discourse.group/t/if-condition-to-check-number-of-rows-without-using-load-rds-data-component/2508/5 "2025-01-28T14:02:36Z")

</div>

if you need any help in things you can reach me out.

thank you
