# Function Blocks

**URL:** <https://community.thunkable.com/t/function-blocks/3847965>\
**Category:** Questions about Thunkable X\
**Created:** [May 20, 2025, 11:32am UTC](https://community.thunkable.com/t/function-blocks/3847965 "2025-05-20T11:32:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aaronteh0103h5ewk1](https://avatars.discourse-cdn.com/v4/letter/a/34f0e0/32.png) [@aaronteh0103h5ewk1](https://community.thunkable.com/u/aaronteh0103h5ewk1)\
**Post date:** [May 20, 2025, 11:32am UTC](https://community.thunkable.com/t/function-blocks/3847965/1 "2025-05-20T11:32:09Z")

</div>

how do you use the function with return block.  
I watch the tutorial but still don’t understand.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [May 20, 2025, 3:37pm UTC](https://community.thunkable.com/t/function-blocks/3847965/2 "2025-05-20T15:37:27Z")

</div>

**A function can do two main things: (1) It can run code blocks and (2) it can return a value.**

You might use this is you are finding the smallest number in a list of numbers. So the input to the function would be a variable containing a list of those numbers. And the output (return) would be the smallest number. The code inside the function would do the work of determining which list item (number) is smallest.

**Here’s a representation of that process:**

{3,5,1,7,8} → 1

**Once created, you would use the function like this:**

Set label’s text to smallestNumberFunction [app variable listOfNumbers]

**Functions are a little like “black boxes” in math:**

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/a/aa7343dd356fc7bfedf3c0a30c047a6c48345890.png)

For that function, the input is 3 and the output (return) is 9. The function does the work to square the input. A function might have a few blocks or dozens of blocks depending on what it does.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [August 18, 2025, 3:37pm UTC](https://community.thunkable.com/t/function-blocks/3847965/3 "2025-08-18T15:37:46Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
