Skip to content

Commit

Permalink
docs: 📝 Condition block
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Apr 9, 2022
1 parent c5ffd8c commit b1d30fc
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 18 deletions.
23 changes: 23 additions & 0 deletions apps/docs/docs/editor/blocks/condition.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { YoutubeEmbed } from '../../../src/js/YoutubeEmbed.jsx'

# Condition

The Condition block allows you to split your flow in two based on a condition.

<img src="/img/blocks/condition.png" width="500" alt="Set variable" />

☝️ This can be translated to: "If 'Score' is greater than 20 then go to this path. Otherwise, go to the other path.".

A condition can contain different comparisons that are evaluated in order and linked with a logical operator: 'AND' or 'OR'.

## 3 minutes video overview

<YoutubeEmbed videoId="47KyLHzdpnY" />

## Advanced

For more complex use cases you can stack conditions on top of each other:

<img src="/img/blocks/condition-2.png" width="500" alt="Set variable" />

☝️ This can be translated to: "If 'Age' is greater than 50 then go to this path. Else, if 'Age' is greater than 20 then go to this path. Otherwise, got to the other path".
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
import { YoutubeEmbed } from '../../src/js/YoutubeEmbed.jsx'

# Variables

Variables are placeholders for content that you can then use anywhere in the Typebot. It's a very important concept to understand to truly create a customized experience for the user.

## Save an answer in a variable

You can tell your input step to save the answer into a variable and reuse then in a further bubble for example:
<img src="/img/variables/question.png" width="800" alt="Iframe preview"/>

<img src="/img/variables/question.png" width="800" alt="Iframe preview" />

## Advanced concepts

Here is a quick video that showcase advanced concepts about variables:

<iframe width="900" height="500" src="https://www.youtube.com/embed/o715Tjv1ijI" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<YoutubeEmbed videoId="o715Tjv1ijI" />

### Prefilled variables

Expand Down Expand Up @@ -42,8 +45,12 @@ These are simply variables that are declared in the bot flow but aren't displaye

These can be simply declared with "Set variable" steps:

<img src="/img/variables/declaring.png" width="300" alt="Iframe preview"/>
<img src="/img/variables/declaring.png" width="300" alt="Iframe preview" />

Then the values will be available on the Results page in specific columns:

<img src="/img/variables/hiddenVariablesResults.png" width="500" alt="Iframe preview"/>
<img
src="/img/variables/hiddenVariablesResults.png"
width="500"
alt="Iframe preview"
/>
9 changes: 0 additions & 9 deletions apps/docs/docs/get-started/overview.md

This file was deleted.

11 changes: 11 additions & 0 deletions apps/docs/docs/get-started/overview.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
sidebar_position: 2
---

import { YoutubeEmbed } from '../../src/js/YoutubeEmbed.jsx'

# Overview

The best way to understand the basic principles of Typebot is by watching the "Get started" video series:

<YoutubeEmbed videoId="https://www.youtube.com/embed/videoseries?list=PLHpyDlgo4x7NUjF-L5VaYfBPQ03uzf5l3" />
5 changes: 0 additions & 5 deletions apps/docs/docs/integrations/google-sheets.md

This file was deleted.

7 changes: 7 additions & 0 deletions apps/docs/docs/integrations/google-sheets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { YoutubeEmbed } from '../../src/js/YoutubeEmbed.jsx'

# Google Sheets

With the Google Sheets integration step, you can inject, update or get data from Google Spreadsheets. For an overview of how it works check out this video

<YoutubeEmbed videoId="UjlZvlqg6mA" />
17 changes: 17 additions & 0 deletions apps/docs/src/js/YoutubeEmbed.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'

export const YoutubeEmbed = ({ videoId }) => (
<iframe
width="100%"
height="500"
src={
videoId.startsWith('https')
? videoId
: `https://www.youtube.com/embed/${videoId}`
}
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
style={{ borderRadius: '0.5rem' }}
/>
)
Binary file added apps/docs/static/img/blocks/condition-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/docs/static/img/blocks/condition.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

5 comments on commit b1d30fc

@vercel
Copy link

@vercel vercel bot commented on b1d30fc Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b1d30fc Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./apps/docs

docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io

@vercel
Copy link

@vercel vercel bot commented on b1d30fc Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
builder-v2-typebot-io.vercel.app

@vercel
Copy link

@vercel vercel bot commented on b1d30fc Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on b1d30fc Apr 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.