# Using User defined function from snowflake in dbt model

**URL:** <https://discourse.getdbt.com/t/using-user-defined-function-from-snowflake-in-dbt-model/8734>\
**Category:** Help\
**Created:** [June 16, 2023, 2:03am UTC](https://discourse.getdbt.com/t/using-user-defined-function-from-snowflake-in-dbt-model/8734 "2023-06-16T02:03:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Surya](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/surya/32/3763_2.png) [@Surya](https://discourse.getdbt.com/u/Surya)\
**Post date:** [June 16, 2023, 2:42am UTC](https://discourse.getdbt.com/t/using-user-defined-function-from-snowflake-in-dbt-model/8734/2 "2023-06-16T02:42:37Z")

</div>

@jayasfps  
Plz refer this

> [@Call a dataset persistent function with a ref](https://discourse.getdbt.com/t/call-a-dataset-persistent-function-with-a-ref/7422):
>
> I’m migrating a view from bigquery and it uses a couple persistent functions written in javascript. Since they aren’t written in sql, I cannot use a macro to reproduce them, so I probably have to call them in my dbt model. Since I have to write my project\_id and dataset\_id in order to call the function, is there a way to add these as source and call the function using a ref, so the model respects modularity of sources? Thank you!

---

_[View the full topic](https://discourse.getdbt.com/t/using-user-defined-function-from-snowflake-in-dbt-model/8734)._
