Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b057cb9

Browse files
adnanqaopsgitbook-bot
authored andcommitted
GITBOOK-159: Manual Mode Vs Mapped Mode
1 parent 1803486 commit b057cb9

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

docs/.gitbook/assets/image (1).png

316 KB
Loading

docs/.gitbook/assets/image (2).png

6.54 KB
Loading

docs/.gitbook/assets/image.png

121 KB
Loading

docs/build-applications/app-editor/option-lists.md

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,22 @@ When more than one option in one list uses the same value, only the first option
1717

1818
## Manual mode
1919

20-
Under **Basic** > **Manual**, click **+ Add** to create a new option. Select an option to manually configure it. You can click `···` to **Duplicate** or **Delete** an option and drag `⋮⋮` to arrange its position.
20+
In Manual Mode, data is entered into a Component manually. Users have to add entries one by one. Some components with Manual mode of data entry are :
2121

22-
Check the value of the selected option under **Components** in the data browser. For example, when **New York** is selected, you can find the string value `"1"` for **locationSelect**.
22+
1. Select / Multi-Select
23+
2. Dropdown
24+
25+
<figure><img src="../../.gitbook/assets/image.png" alt=""><figcaption></figcaption></figure>
26+
27+
**Example :**
28+
29+
Let’s take an example where a User has to choose his/her favourite color from a list of colors. We will use the **Select** component for this example. Please, go via the following demo. All the details have been explained in it.
30+
31+
**App link :** [**https://app.lowcoder.cloud/apps/668e6c60ba4684206ee5d15e/view**](https://app.lowcoder.cloud/apps/668e6c60ba4684206ee5d15e/view)
32+
33+
**Demo :**&#x20;
34+
35+
{% embed url="https://app.supademo.com/demo/clyfrzyi60b6dai225qmc08sw" %}
2336

2437
Manual mode is recommended for these scenarios:
2538

@@ -29,8 +42,30 @@ Manual mode is recommended for these scenarios:
2942

3043
## Mapped mode
3144

32-
When you have option list data that comes from data sources, transformers or temporary state, you can use **Mapped Mode**. Under **Basic** > **Mapped**, input your data source array in **Data** box using JavaScript (JS) code. A list of options will be automatically mapped from this array. For example, access university information via `{{university.data}}`. Each item in the result array contains `country`, `web_pages`, `alpha_two_code`, and `name`.
45+
In Mapped mode, data is usually coming from a Data source ( like an API or DB ), Transformer or Temporary state, Or it can be in JSON format. In other words, we use Mapped mode when we have dynamic data. Admin only needs to map the relevant data to respective fields, without mapping each value to a field. It’s fast and dynamic. E.g. we should use Mapped mode when we need to show a list of Countries name coming via an API. Some components with Mapped mode of data entry are :
46+
47+
1. Select / Multi-Select
48+
2. Dropdown
49+
50+
<figure><img src="../../.gitbook/assets/image (1).png" alt=""><figcaption></figcaption></figure>
51+
52+
**Example :**
53+
54+
Let’s take the 1st example where data is in JSON format, and contains a List of Objects where each object has a name and link fields. In the 2nd example, we show a list of all countries' names in a dropdown. Let’s go via following demo to understand the key concepts around Mapped data mode.
55+
56+
**App link :** [**https://app.lowcoder.cloud/apps/667eb219f0558f2f43e386c3/view**](https://app.lowcoder.cloud/apps/667eb219f0558f2f43e386c3/view)
57+
58+
**Demo :**&#x20;
59+
60+
{% embed url="https://app.supademo.com/demo/clyfv3enn0byiai22mzzuskq1" %}
61+
62+
**When to use Mapped Mode:**
63+
64+
* When we have data coming from a Data source like API or DB, Transformer or Temporary state.
65+
* When data is used by multiple components.
66+
67+
### Key difference b/w Manual & Mapped Mode : <a href="#howd0cosepq3" id="howd0cosepq3"></a>
68+
3369

34-
You can reference the value of any filed of an option through `item` and its index `i`, starting from 0. In the following example, the **Label** of each option is the `name` of the university, the **Value** is the `web_page`, and those containing an opening parenthesis `(` in their names are disabled. The default value is set to the `web_pages` of the first item using `{{university.data[0].web_pages}}`. Note that the default value of an option list should be an element from the **Value** array but not the **Label** array.
3570

36-
Check the value of the selected option under **Components** in the data browser. For example, when "Ahi Evran University" is selected, its string value `[\"http://www.ahievran.edu.tr/\"]` is displayed.
71+
<table><thead><tr><th width="270">Details</th><th width="214">Use Manual Mode</th><th>Use Mapped Mode</th></tr></thead><tbody><tr><td>When data is coming via a Data source like API or DB</td><td>No</td><td>Yes</td></tr><tr><td>When data is used in multiple components</td><td>No</td><td>Yes</td></tr><tr><td>When Data is small/manageable</td><td>Yes</td><td>No</td></tr><tr><td>When data is used in single component</td><td>Yes</td><td>No</td></tr></tbody></table>

0 commit comments

Comments
 (0)