管理自訂欄位Manage custom fields

您可以在任何實體中建立與更新一或多個自訂欄位。You can create and update one or more custom fields in any entity. 當您建立自訂欄位時,您可以指定一組屬性,例如欄位名稱、其顯示名稱,以及其將包含的資料類型。When you create a custom field, you specify a set of properties, such as the field's name, its display name, and the type of data that it will contain. 如需詳細資訊,請參閱實體欄位資料類型實體欄位屬性For more information, see Enity field data types and Entity field properties.

注意︰每個實體都有系統欄位,例如指出上次更新記錄的時間及其更新者的欄位。Note: Every entity has system fields, such as fields that indicate when a record was last updated, and who updated it. 此外,標準實體具有標準 (預設) 欄位。In addition, standard entities have standard (default) fields. 您無法修改或刪除系統欄位或標準欄位。You can't modify or delete system fields or standard fields. 如果您建立自訂欄位,它應該會提供這些內建欄位頂端的功能。If you create a custom field, it should provide functionality on top of these built-in fields.

建立欄位Create a field

  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. 實體清單隨即出現。A list of entities appears. 若要在清單頂端顯示自訂實體,請按一下或點選 [類型] 資料行標頭。To show custom entities at the top of the list, click or tap the Type column header. 您也可以在搜尋列中輸入一或多個字元,來篩選清單。You can also filter the list by typing one or more characters in the search bar.
  2. 按一下或點選實體,然後按一下或點選靠近畫面頂端的 [新增欄位] 。Click or tap an entity, and then click or tap Add field near the top of the screen.
  3. 在 [顯示名稱] 下,指定將用來讓使用者識別該欄位的文字字串。Under Display name, specify the string of text that will identify the field to users. 如需詳細資訊,請參閱建立應用程式For more information, see Create an app.
  4. 在 [名稱] 下,指定您用來參照該欄位的文字字串,例如,您在建置應用程式時所參照的欄位。Under Name, specify the string of text that you will use to refer to the field in, for example, a formula when you build an app.

    重要:請指定一個獨特、清楚且有意義的名稱,因為在建立欄位後便無法變更該名稱。Important: Specify a name that's unique, clear, and meaningful, because you can't change the name after you create the field.

  5. 在 [類型] 下,指定該欄位將包含的資料類型,例如 [文字] 或 [數字]。Under Type, specify the type of data that the field will contain, such as Text or Number.

    重要︰在欄位包含資料之後便無法變更此屬性,因此請謹慎指定。Important: Specify this property carefully, because you might not be able to change it after the field contains data. 如需您可以指定的資料類型相關資訊,請參閱了解實體For information about the types of data that you can specify, see Understand entities.

  6. 如果出現提示,請為您所指定的資料類型指定其他資訊。If you're prompted, specify additional information for the data type that you specified.
  7. 如果每筆記錄在此欄位中的值必須是唯一的,請選取 [唯一] 下的核取方塊。Under Unique, select the check box if every record must have a unique value in this field.
  8. 如果每筆記錄在此欄位中必須有值,請選取 [必填] 下的核取方塊。Under Required, select the check box if every record must have a value in this field.

    重要:您無法要求標準實體中的自訂欄位必須包含資料。Important: You can't require that a custom field in a standard entity contain data. 此限制可防止您破壞任何依賴該實體的應用程式。This restriction prevents you from breaking any apps that rely on that entity.

  9. 按一下或點選 [儲存] 提交您的變更。Click or tap Save to submit your changes.

    重要︰如果您未儲存變更即在瀏覽器中開啟另一個頁面或結束瀏覽器,您的變更將會遺失。Important: Your changes will be lost if you don't save them before you open another page in the browser or exit the browser.

作業順利完成時會通知您。You're notified when the operation is completed successfully. 如果作業失敗,錯誤訊息會指出發生的問題,以及修正問題的方式。If the operation is unsuccessful, an error message indicates the issues that occurred and how you can fix them.

更新或刪除欄位Update or delete a field

  1. powerapps.com 中,按一下或點選 [管理]、按一下或點選 [實體],然後按一下或點選某個實體。On powerapps.com, click or tap Manage, click or tap Entities, and then click or tap an entity.
  2. 在您所選取實體的欄位清單中,按一下或點選某個欄位,並遵循下列其中一個步驟︰In the list of fields for the entity that you selected, click or tap a field, and then follow one of these steps:

    • 變更欄位的一個或多個屬性。Change one or more properties of the field. 請記住最佳做法與限制Keep in mind the best practices and restrictions.

      若要選取下一個屬性,請按 Tab 鍵。若要復原欄位的所有變更,請按一下或點選欄位的省略符號 (...),然後按一下或點選 [復原]。To select the next property, press Tab. To undo all changes to a field, click or tap the ellipsis (...) for the field, and then click or tap Undo.

    • 刪除欄位,做法是按一下或點選靠近欄位右側邊緣的省略符號 (...),然後按一下或點選 [刪除]。Delete the field by clicking or tapping the ellipsis (...) near the right edge of the field, and then clicking or tapping Delete.
  3. 按一下或點選 [儲存] 提交您的變更。Click or tap Save to submit your changes.

    重要︰如果您未儲存變更即在瀏覽器中開啟另一個頁面或結束瀏覽器,您的變更將會遺失。Important: Your changes will be lost if you don't save them before you open another page in the browser or exit the browser.

作業順利完成時會通知您。You're notified when the operation is completed successfully. 如果作業失敗,錯誤訊息會指出發生的問題,以及修正問題的方式。If the operation is unsuccessful, an error message indicates the issues that occurred and how you can fix them.

最佳做法與限制Best practices and restrictions

當您建立及修改欄位時,請記住以下幾點︰As you create and modify fields, keep these points in mind:

  • 您無法修改或刪除系統欄位或其值。You can't modify or delete system fields or their values.
  • 在標準實體中,您無法修改或刪除標準 (預設) 欄位、新增需要資料的欄位,或進行任何其他變更而破壞依賴該實體的應用程式。In a standard entity, you can't modify or delete a standard (default) field, add a field that requires data, or make any other change that might break an app that relies on that entity.
  • 在自訂實體中,您應該確定您所做的變更將不會破壞依賴該實體的任何應用程式。In a custom entity, you should make sure that the changes that you make won't break any app that relies on that entity.
  • 您必須為每個自訂欄位提供一個在實體內為唯一的名稱,欄位建立好後便無法重新命名。You must give each custom field a name that's unique within the entity, and you can't rename a field after you create it.
  • 您可以變更任何欄位的資料類型,前提是該欄位尚未包含任何資料。You can change the data type of any field, provided that the field doesn't yet contain data. 如果欄位已經包含資料,您可以變更資料類型,前提是所有現有的資料都符合新資料類型的需求。If the field already contains data, you can change the data type, provided that all the existing data meets the requirements of the new data type. 例如,您可以將欄位的資料類型從 [數字] 變更為 [字串],但如果欄位包含非數字的資料,您便無法將資料類型從 [字串] 變更為 [數字]。For example, you can change the data type of a field from Number to String, but you can't change the data type from String to Number if the field contains non-numerical data.
  • 如果您以下列一或多種方式修改實體中的欄位,您可能會破壞使用該實體的應用程式:You might break an app that uses an entity if you modify a field in that entity in one or more of these ways:
    • 變更欄位的資料類型。You change the field's data type.
    • 您需要值,但一或多筆記錄的該欄位中未包含任何值。You require values, but one or more records don't contain a value in that field.
    • 您需要唯一的值,但兩筆以上的記錄在該欄位中包含相同的值。You require unique values, but two or more records contain the same value in that 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.