# Control

## Navigate to a Screen

You can manage much of your screen navigation through our [Top Tab](https://docs.thunkable.com/snap-to-place/top-tab-navigator), [Bottom Tab](https://docs.thunkable.com/snap-to-place/bottom-tab-navigator), [Drawer](https://docs.thunkable.com/snap-to-place/drawer-navigator) and [Stack](https://docs.thunkable.com/snap-to-place/stack-navigator) navigator components but for simple screen navigation, you can use the very popular block below

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MZBzZPrTxRQzECz6PHn%2F-MZBzgvTlN1eZtwwJ1k6%2FScreen%20Shot%202021-04-26%20at%208.04.10%20AM.png?alt=media\&token=00dcfbd4-2df6-4a30-a6ce-27a773f7dcab)

{% embed url="<https://youtu.be/mExUv-1dpuQ>" %}

## If `this`, do `that`

![Simplest if this, do that condition](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LD47eXiJPobciN928ey%2F-LD75fUYaMEYRCaSoQ-2%2FScreen%20Shot%202018-05-22%20at%206.47.02%20AM.png?alt=media\&token=dc4840e4-adc6-4958-a4f4-fce539393b06)

In most apps, one event leads to another event if a **condition** is met. To specify these scenarios, the `this`, do `that` block is commonly used with [Logic](https://docs.thunkable.com/snap-to-place/logic) blocks that define the conditions that lead one event to the next.

The if `this`, do `that` block can be transformed to support more complex logic

![The purple settings button can be used to add additional conditions for events](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LD7HGqIQLaYLwJQKawa%2F-LD7JuMKRrzPxaktSrZU%2Fdocs-1.png?alt=media\&token=de97b757-a55e-4a4b-af82-5608917f6790)

{% embed url="<https://youtu.be/RAtGL5GUmj0>" %}

A truthy value is a value that is considered true when encountered in a Boolean context. All values are truthy unless they are defined as falsy. That is, all values are truthy except false, 0, "", null, undefined, and NaN.

**Returns False:**

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FJi7zVD6XNCo2JNuEZp3d%2Ffalse.png?alt=media&#x26;token=2ffbe935-b014-4403-af4c-fddc4c7ad3d1" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FOMQehiKo5CQ1soL6D8Cy%2Fnull.png?alt=media&#x26;token=c3d4881d-9b28-43e4-93d1-0ea3b753bece" alt="" width="553"><figcaption></figcaption></figure></div>

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2F7mgYUIdIXzx2qRtha2uu%2Fzero.png?alt=media&#x26;token=e5149f5d-3fa5-49ff-bbff-f155d3e23756" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FC5mkaoS2Xqrne2JFqh04%2Fempty%20text.png?alt=media&#x26;token=fd8329e7-6704-48a4-b7d4-90c78b0ef448" alt="" width="563"><figcaption></figcaption></figure></div>

**Returns True:**

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FkgiJpsZWon52gLgmIkYD%2Ftrue.png?alt=media&#x26;token=50a2e93e-49d8-480d-b9cf-4ab689e93326" alt="" width="554"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FJUetqSvBe3JSxlllaNYa%2Ftext.png?alt=media&#x26;token=553fc0c5-98c5-4611-a640-c67a55dd6d90" alt="" width="551"><figcaption></figcaption></figure></div>

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FgDY3eubMYlj208w4Xp0x%2Fjson.png?alt=media&#x26;token=0c1132eb-cc77-4f91-a845-c151b23f9096" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2F57G95gvc6gWhsd5K78NC%2Fobject.png?alt=media&#x26;token=78ff1124-7262-4317-a989-7b78cbb5317d" alt="" width="375"><figcaption></figcaption></figure></div>

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FXVVuFkUH6rbzqT8fSOAP%2Fnumber.png?alt=media&#x26;token=3e89b579-bab4-488d-a3a3-55067758f90c" alt="" width="548"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FVVieMCuRcdKan89CxlBa%2Ffalse%20text.png?alt=media&#x26;token=0718ba81-1633-4c6b-88c5-df80b4a98a6f" alt="" width="545"><figcaption></figcaption></figure></div>

<div><figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2F1wHFtibHziES4err2W1q%2F%CF%80.png?alt=media&#x26;token=115df8bf-cc7b-4f69-a323-f4b6224b66a0" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://689802330-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUe3rgJfvQYLrpDR1HfWv%2Fuploads%2FIhJ3xe4QkqTaiJURedoE%2Finfinity.png?alt=media&#x26;token=e9fea6b9-40ce-4b82-b898-b90b8d92bc86" alt="" width="557"><figcaption></figcaption></figure></div>

### Test

The Test block can be used to return a value based on a given condition. If the condition is true, one value is returned. If the condition is false, a different value is returned.

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXleT3gvKM7TKnDEG_h%2F-MXlv0afJcaRLvTewo-I%2FScreen%20Shot%202021-04-08%20at%203.36.51%20PM.png?alt=media\&token=277691dd-4c7d-4a5d-b3b0-2c747f132792)

## Wait

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXleT3gvKM7TKnDEG_h%2F-MXlehjCkYIz57MZvZ6a%2FScreen%20Shot%202021-04-08%20at%202.27.44%20PM.png?alt=media\&token=781f6320-91cd-4557-bc48-fd3f07302373)

Wait the specified amount of time before performing the next action.

## Loops

Repeat a set of blocks for a specified amount of time

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXleT3gvKM7TKnDEG_h%2F-MXltXm3vgLdk1DKXcMf%2FScreen%20Shot%202021-04-08%20at%203.31.44%20PM.png?alt=media\&token=55a0f2ce-8153-4c95-bb0e-f352e30e1d98)

Repeat an action for an unlimited period of time

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn67C0VAFApUlwDa-d%2Fblocks-control-%E2%9C%95-fig-1.png?generation=1524497156542397\&alt=media)

Repeat an action the specified number of times

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn67D73gepGAYh9s8q%2Fblocks-control-%E2%9C%95-fig-3.png?generation=1524497159826957\&alt=media)

Repeat an action for a certain amount of times, with the incrementer index *i*

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXleT3gvKM7TKnDEG_h%2F-MXltynkwlo14I0srj1Z%2FScreen%20Shot%202021-04-08%20at%203.33.51%20PM.png?alt=media\&token=9c9b52c6-754c-44bd-a060-2051186fdf8a)

Repeat an action over every item in a list

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXleT3gvKM7TKnDEG_h%2F-MXluIqqMMZEARXVBNC_%2FScreen%20Shot%202021-04-08%20at%203.35.12%20PM.png?alt=media\&token=3a5eb619-b09d-4fab-b51a-3f6c9d52d758)

Repeats an action while a condition is true

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAq0rZDF72HjL3d079b%2F-LAq1t_nOvwy1Djb4Zam%2Fblocks-control-%E2%9C%95-fig-5.png?alt=media\&token=b9692b8a-9235-4f08-9a46-ad13fe7ddb90)

Break out of an existing loop

## Open an Installed App or Website by Link

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn67AX3DtlqidVUA7T%2Fblocks-control-%E2%9C%95-fig-6.png?generation=1524497179533439\&alt=media)

You can prompt a user to open a page within an app installed on their phone or a URL in their browser using the block above.

Thanks to the development of universal links for iOS and Android app links, you simply need to enter the URL of the webpage for your app to automatically open to the app if it's installed or open the web browser if it is not.

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LKdDT8MnfHwH_PJfJa0%2F-LKdEcXxMVeP9XZcs6RL%2FScreen%20Shot%202018-08-23%20at%205.03.34%20PM.png?alt=media\&token=6bd25466-9309-4b87-8d9f-d2cfce57f836)
