# Tạo trường dữ liệu thuộc tính

### **1. Truy cập trang&#x20;*****Thuộc tính*****&#x20;để tạo thuộc tính**

![](/files/-LwWMgeoCw9de-9gNaBD)

Các thuộc tính có mầu Vàng cam là các thuộc tính Mặc định hệ thống tự sinh ra, bạn có thể sử dụng ngay mà không cần phải tạo thêm.\
Với các thuộc tính không có nút bấm để xem Mã nguồn (script) tức là SDK của Pushdy sẽ cố gắng tự động do tìm từ thông tin thiết bị của End-User. Trong trường hợp giá trị này không được ghi nhận, bạn có thể sử dụng Script hoặc RestAPI để ghi nhận giá trị như những thuộc tính thông thường.

### **2. Tạo thuộc tính mới**

Để tạo thuộc tính mới bạn Click nút bấm **Thêm thuộc tính**.

![](/files/-LwrARiBX4tQHirxfHlC)

* *Tiêu đề:* Nhãn/tên gợi nhớ cho thuộc tính, sử dụng khi tạo các bộ lọc cho phân đoạn người dùng. Bạn nên tạo nhãn để khi đọc dễ dàng hình dung ra thuộc tính mà bàn sử dụng.
* *Mã:* Mã của thuộc tính. Độ dài từ 2 đến 100 ký tự. Bạn chỉ được phép nhập các ký tự theo biểu thức điều kiện sau **\[a-zA-Z0-9\_]**
* *Loại:* Kiểu dữ liệu của thuộc tính bạn định nghĩa.

### 3. Lấy mã nguồn để gắn vào App của bạn.

Sau khi tạo thuộc tính thành công, bạn hãy click vào nút bấm vào nút "Mã nguồn" để lấy mã nguồn gắn vào App của bạn để Pushdy SDK gửi dữ liệu lên hệ thống Pushdy phục vụ nhu cầu phân đoạn user theo thuộc tính cho các Push Notification của bạn.

{% tabs %}
{% tab title="cURL" %}

```
curl  --header "Content-Type: application/json" \
      --header "client-key: CLIENT-KEY" \
      --data '{"followed_items": ["iPhone", "Laptop"] }' \
      --request "PUT" "https://api.pushdi.com/player/PLAYER_ID"
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
PushdyIns.push(function() {
    PushdyIns.pushAttribute('followed_items', ["iPhone", "Laptop"]);
});
```

{% endtab %}

{% tab title="Objective-C" %}

```objectivec
NSArray *your_values_array = @[@"iPhone", @"Laptop"];
[Pushdy pushAttribute:@"followed_items" value:your_values_array error:nil];
```

{% endtab %}

{% tab title="Swift" %}

```swift
let your_values_array:[String] = ["iPhone", "Laptop"]
try? Pushdy.pushAttribute("followed_items", value: your_values_array)
```

{% endtab %}

{% tab title="Java" %}

```
String[] your_values_array = {"iPhone", "Laptop"};
Pushdy.pushAttribute("followed_items", your_values_array);
```

{% endtab %}

{% tab title="Kotlin" %}

```
val your_values_array = arrayOf("iPhone", "Laptop");
Pushdy.pushAttribute("followed_items", your_values_array)
```

{% endtab %}
{% endtabs %}


---

# 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://guide.pushdy.com/i/huong-dan-su-dung/tao-thuoc-tinh.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.
