# 載入頁面時，使用其它頁面的值初始化表單欄位

## 原理

在 render page 前，執行 PL/SQL 程式，從 Session State 取得其它頁面的 item 的值。之後，將這些值指派到目的頁面的欄位。

![](/files/d6Vpblw63Rrf63O9GfJT)

## User Story

S1. 使用者在 Page 3 輸入空間預約表單

![](/files/uzwmv5Sj7yCyVBezoskD)

S2. 按下確定後，要轉跳到 Page 4， 顯示方才輸入的資料，供使用者確認。

![](/files/4Y1xaddaNe3uRAWZzyXf)

## 設定步驟

S1. 在 Page 4 的 Before Region 節點，新增 Process

* 為 Process 設定 Name.
* 確認屬性&#x20;
  * Identification > Type: Execute Code
  * Source > Language: PL/SQL

![](/files/AihYMSGEh4jD6LKKyrgN)

S2. 在 Source > PL/SQL code 中輸入以下:

```plsql
begin

:P4_SAPCE := :P3_SPACE;
:P4_ITIME := :P3_TIME;
:P4_IDATE := :P3_DATE;
:P4_UID_1 := :P3_ID_1;
:P4_UID_2 := :P3_ID_2;

end;
```

Page Item 前使用冒號，表示要存取 Session State 中 Item 的值。

S3. 結束。


---

# 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://hychen39.gitbook.io/apex-notes/forms/zai-ru-ye-mian-shi-shi-yong-qi-ta-ye-mian-de-zhi-chu-shi-hua-biao-dan-lan-wei.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.
