建立自訂實體Create a custom entity

您可以建立自訂實體來儲存組織特有的資料。You can create a custom entity to store data that is specific to your organization. 您接著可以開發參考實體的應用程式來顯示該資料。You can then show that data by developing an app that refers to the entity.

有兩種方式可以建立實體︰There are two ways to create an entity:

在這兩種情況下,Microsoft PowerApps 都會自動儲存並協助保護資料安全。In both cases, Microsoft PowerApps automatically stores and helps secure the data. 建立實體後,您可以建立或修改一或多個它的欄位,並建置實體之間的關聯性After you create an entity, you can create or modify one or more of its fields, and build relationships between entities.

注意

建立實體之前,請參閱標準實體清單Before you create an entity, see the list of standard entities. 這些實體涵蓋一般案例,例如帳戶和連絡人。These entities cover typical scenarios, such as accounts and contacts. 如果這其中一個實體只要進行些微變更就能立即符合您的需求,您就能從該實體開始,以便為自己節省一些時間。If one of these entities will meet your requirements out of the box or after only minor changes, you can save yourself some time by starting with that entity.

建立實體Create an entity

  1. powerapps.com 中,展開 [Common Data Service] 區段,然後按一下或點選左側導覽窗格中的 [實體]。On powerapps.com, expand the Common Data Service section and click or tap Entities in the left navigation pane.
  2. 如果您尚未建立資料庫,您需要建立一個。If you haven't created a database, you need to create one. 如需詳細資訊,請參閱建立 Common Data Service 資料庫For more information, see Create a Common Data Service database.
  3. 按一下或點選右上角附近的 [新增實體]。Near the upper-right corner, click or tap New entity.
  4. 在 [實體名稱] 欄位中,輸入實體的名稱。In the Entity name field, enter a name for the entity. 確定該名稱是清楚且有意義的名稱,因為您在建立該實體後便無法變更此名稱。Make sure that the name is clear and meaningful, because you can't change it after you create the entity. 當您開發應用程式時,您將在公式中透過此名稱參考實體。When you develop an app, you will reference the entity by this name in a formula.
  5. 指定顯示名稱,並 (選擇性) 輸入實體的說明,然後按一下或點選 [下一步]。Specify a display name and, optionally, a description for the entity, and then click or tap Next.
  6. 選擇性:將 [標題] 欄位中的值變更為對您的資料而言更具意義的名稱。Optional: Change the value in the Title field to something that is more meaningful for your data.
  7. 按一下或點選 [建立] 以建立實體。Click or tap Create to create the entity.

實體會出現在您資料庫的實體清單中。Your entity appears in the list of entities in your database. 若要在清單頂端顯示您的實體,請按一下或點選 [類型] 資料行標頭。To show your entity at the top of the list, click or tap the Type column header. 系統將依類型排序實體,所有的自訂實體都將出現在所有標準實體的上方。The entities will be sorted by type, and all custom entities will appear above all standard entities.

系統欄位和記錄標題欄位System fields and the record title field

所有實體都具有五個系統欄位。All entities have five system fields. 這些欄位是唯讀的。These fields are read-only. 因此您無法變更或刪除這些欄位,而且不需指派值給它們。Therefore, you can't change or delete these fields, and you don't assign values to them.

顯示名稱Display name 系統欄位名稱System field name 資料類型Data type 說明Description
識別碼Id 系統欄位名稱System field name Big IntegerBig Integer 記錄的唯一識別碼。The unique identifier for the record.
建立者Created By CreatedByUserCreatedByUser 文字Text 建立記錄的使用者。The user who created a record.
記錄的建立日期Created Record Date CreatedOnDateTimeCreatedOnDateTime DateTimeDateTime 記錄的建立日期與時間。The date and time when a record was created.
上次修改者Last modified By LastModifiedByUserLastModifiedByUser 文字Text 最近一次修改記錄的使用者。The user who most recently modified the record.
記錄的修改日期Modified Record Date LastModifiedDateTimeLastModifiedDateTime DateTimeDateTime 最近一次修改記錄的日期與時間。The date and time when a record was most recently modified.

如果您從頭開始建立實體,則該實體也會包含名為標題的自訂欄位。If you create an entity from scratch, it also contains a custom field that is named Title. 此欄位會設定為記錄的 [標題] 欄位。This field is set as the record's Title field. 每當您在應用程式中使用記錄時,[標題] 欄位值就是該記錄的使用者易記識別碼。The Title field value is the user-friendly identifier of a record whenever you use that record in an app. 您可以變更哪個欄位是 [標題] 欄位,但每個實體都必須有一個 [標題] 欄位。You can change which field is the Title field, but every entity must have a Title field.

後續步驟Next steps

隱私權注意事項Privacy notice

透過 Microsoft PowerApps 常見資料模型,我們可以在診斷系統中收集和儲存自訂實體和欄位名稱。With the Microsoft PowerApps common data model we collect and store custom entity and field names in our diagnostic systems. 我們使用這個知識來改善客戶的常見資料模型。We use this knowledge to improve the common data model for our customers. 建立者所建立的實體和欄位名稱有助於我們了解 Microsoft PowerApps 社群中常見的案例,並確認服務的標準實體涵蓋範圍中的落差 (例如與組織相關的結構描述)。The entity and field names that Creators create help us understand scenarios that are common across the Microsoft PowerApps community and ascertain gaps in the service’s standard entity coverage, such as schemas related to organizations. Microsoft 不會存取或使用這些實體之相關資料庫資料表中的資料,亦不會在資料庫佈建區域以外的區域複寫此資料。The data in the database tables associated with these entities is not accessed or used by Microsoft or replicated outside of the region in which the database is provisioned. 但請注意,自訂實體和欄位名稱可能會跨區域複寫,並會根據我們的資料保留原則進行刪除。Note, however, the custom entity and field names may be replicated across regions and are deleted in accordance with our data retention policies. Microsoft 致力於保護您的隱私權,如信任中心 (英文) 的詳細說明所述。Microsoft is committed to your privacy as described further in our Trust Center.