# @for

* 여러 동작을 반복해야 할 때 사용해요.
* 동일한 코드를 여러 번 반복할 수 있어요.
* List나 Document의 내부에 있는 내용을 가져와 실행해요.

ex) 모든 유저 데이터를 가져와 각 유저 정보의 인증 상태를 확인한 후 각 유저에게 알림톡을 보낼 경우.

**사용 방법**

<div align="left"><figure><img src="/files/rq7ShP83JKNnpGwsgVj6" alt=""><figcaption></figcaption></figure></div>

1. 로직 설정 ➡︎ If When, Where에 원하는 값 입력 ➡︎ New data query 를 펼쳐 주세요. &#x20;
2. Event에서 @for을 드래그앤드롭하여 원하는 위치(flows, #ifTrue, #ifFalse, @for)에 넣어주세요.

<div align="left"><figure><img src="/files/HVMD7tlmjBX51xArKFc7" alt="" width="563"><figcaption></figcaption></figure></div>

위의 이미지와 같이 input과 type에 값을 넣고 반복 동작할 동적 코딩 액션을 정의해요.

* type에는 List일 경우 objectList, Document일 경우 Document를 작성해 주세요.
* input에는 위의 type에 맞는 동적 키 값을 입력해요.

**필드 설명**

* input(List, 동적 키, 동적 Object) (최종형 List or Document) (필수)
  * 반복 동작할 Object를 설정해요.&#x20;
  * 동적 키 값은 Document 형과 List 형으로 작성할 수 있어요.&#x20;
* type(String) (필수)
  * input의 타입을 명시해요.&#x20;
  * List일 경우 “objectList”
  * Document의 경우 “Document”
* \#setChild(Object, String) (선택)
  * 반복 동작할 요소가 저장될 tmpDocument의 key를 설정할 수 있어요.&#x20;
  * tmpDocument 내부에 저장돼요.&#x20;
  * List 형
    * List 내부의 반복 동작하는 값 들의 위치를 저장해요.&#x20;
    * “#setChild”의 값은 String 값이어야 해요.&#x20;
  * Document형
    * Document 내부의 반복 동작하는 key, value 의 위치를 저장해요.&#x20;
    * “#setChild”의 값은 Document 이여야 하며 key, value는 필수 값이에요.
* flows(List) (필수)
  * 반복 동작 할 동적코딩 액션을 정의해요.
  * 동적 코딩의 flows와 같은 액션을 넣을 수 있어요.

2024.01.16 Jinny


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ohmyapp.io/main/guide/develop_app/command-execute-function/create-logic/conditions/detailed-processing-conditions/for.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
