# @operation

* 숫자 연산을 수행하고 그 결과를 tmpDocument의 원하는 위치에 저장해요.

ex) 현재 유저의 모든 주문 데이터의 평균 주문 금액을 유저 데이터에 저장할 경우, 결제 취소건에서 취소 금액을 현재 주문한 금액에 -1 을 곱한 값으로 넣을 경우 등.&#x20;

**사용 방법**

<figure><img src="/files/INUQnpd3wBijHOIenI71" alt=""><figcaption></figcaption></figure>

* 로직 설정 ➡︎ If When, Where에 원하는 값 입력 ➡︎ New data query 를 펼쳐 주세요. &#x20;
* Event에서 @operation을 드래그앤드롭하여 원하는 위치(flows, #ifTrue, #ifFalse, @for)에 넣어주세요.
* 아래의 이미지와 같이 #calculate, #setValue, #type에 필요한 값을 작성해 주세요.

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

* 연산자와 피연산자가 쌍으로 있을 경우에는 2개 이상으로 더 들어갈 수 있어요.&#x20;

ex) ("\*",0.033 / "\*",0.5)

<div align="left"><figure><img src="/files/9OtD2MR0F8TUwnqG475w" alt="" width="375"><figcaption></figcaption></figure></div>

**필드 설명**

* \#calculate (List) (필수)
  * List 내부에는 최종 데이터형이 Number인 데이터 (동적 키, 동적 Object)와 연산자가 들어가요.&#x20;
  * 연산자는 피연산자와 쌍을 이룰 시, 2개 이상이 들어갈 수 있어요.
    * "+" : 덧셈 연산자예요.&#x20;
    * "-" : 뺄셈 연산자예요.&#x20;
    * "/" : 나눗셈 연산자예요.
    * "%" : 나머지 연산자예요.&#x20;
    * "\*" : 곱셈 연산자예요.&#x20;
* \#setValue (String) (필수)
  * 연산의 결과가 저장되는 tmpDocument 내부의 key 이름이에요.&#x20;
* \#type (String) (필수)
  * 연산 결과의 원하는 타입을 지정해요.
    * int : 결과가 정수형으로 저장돼요.
    * float : 결과가 소수형으로 저장돼요.&#x20;
    * string : 결과가 문자열형으로 저장돼요.

2024.03.11 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/operation.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.
