> For the complete documentation index, see [llms.txt](https://docs.ngsurvey.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ngsurvey.com/ar/projects/import-export/xlsform/wrqh-alastbyan/thw-slh.md).

# ذو صلة

عمود الصلة يُستخدم للتحكم في موعد عرض سؤال أو مجموعة، بناءً على إجابات المستخدم السابقة. في ngSurvey سيتم تحويل هذه إلى مجموعات وقواعد Skip Logic.

لن يتم عرض السؤال إلا إذا كانت شرط الصلة صحيحًا.

## 📏 كيفية كتابة شروط الصلة

للإشارة إلى إجابة سؤال سابق، تُستخدم الصيغة التالية:

`${variablename}`

هذا يُدرج قيمة الإجابة من السؤال الذي يحمل الاسم `variablename`.

يمكنك بعد ذلك بناء شرط باستخدام تعابير منطقية مثل:

* `${age} >= 18`
* `selected(${gender}, 'female')`
* `${consent} = 'yes'`

يجب أن تُرجع تعابير الصلة القيمة true ليظهر السؤال.

## 🕵 الصلة في المجموعات

يمكنك تطبيق الصلة على مجموعة ككل:

* إذا كانت المجموعة تستخدم appearance: field-list، فستُعرض أو تُخفي صفحة الأسئلة بالكامل معًا.
* إذا لم يكن للمجموعة appearance فبإمكان تعيين الصلة بشكل فردي على كل صف داخل المجموعة لمنطق تخطي أكثر تفصيلاً.

هذا يتيح تخطيطات مرنة، حيث يمكن عرض صفحات كاملة أو أسئلة فرعية فردية وفقًا لشرط.

## أمثلة

| اسم السؤال | تعبير الصلة                   | Description                                     |
| ---------- | ----------------------------- | ----------------------------------------------- |
| age        |                               | حقل إدخال رقمي (يستخدمه آخرون)                  |
| gender     |                               | حقل select\_one                                 |
| school     | ${age} >= 18                  | عرضه فقط إذا كان المستجيب يبلغ 18 عامًا أو أكثر |
| pregnant   | selected(${gender}, 'female') | عرضه فقط إذا اختار المستجيب 'female'            |
| job\_title | ${consent} = 'yes'            | عرضه فقط إذا أعطى المستجيب الموافقة             |

## 🔢 العوامل والدوال

هذه هي العوامل التي يمكنك استخدامها لبناء المنطق.

#### عوامل المقارنة

تقوم هذه بمقارنة القيم:

| المعامل | المعنى           | Example               |
| ------- | ---------------- | --------------------- |
| =       | يساوي            | `${age} = 18`         |
| !=      | لا يساوي         | `${gender} != 'male'` |
| >       | أكبر من          | `${age} > 25`         |
| <       | أصغر من          | `${score} < 60`       |
| >=      | أكبر من أو يساوي | `${age} >= 18`        |
| <=      | أصغر من أو يساوي | `${score} <= 100`     |

***

#### العوامل المنطقية

تُساعدك هذه في دمج الشروط:

| المعامل | المعنى                       | Example                                       |
| ------- | ---------------------------- | --------------------------------------------- |
| و       | يجب أن يكون كلاهما صحيحًا    | `${age} >= 18 and ${consent} = 'yes'`         |
| أو      | يمكن أن يكون أي منهما صحيحًا | `${gender} = 'female' or ${gender} = 'other'` |
| not()   | عكس القيمة true              | `not(selected(${gender}, 'female'))`          |

***

#### دوال التحديد

تُستخدم غالبًا مع `select_one` و `select_multiple` الأسئلة.

| Function   | Description                    | Example                         |
| ---------- | ------------------------------ | ------------------------------- |
| selected() | يتحقق مما إذا كانت قيمة مختارة | `selected(${gender}, 'female')` |

***

#### دوال التاريخ والوقت

| Function | Description                  | Example                    |
| -------- | ---------------------------- | -------------------------- |
| today()  | ترجع التاريخ الحالي          | `${birthdate} <= today()`  |
| now()    | ترجع التاريخ والوقت الحاليين | `${checkin_time} <= now()` |
|          |                              |                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ngsurvey.com/ar/projects/import-export/xlsform/wrqh-alastbyan/thw-slh.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
