Properties Service
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
المواقع
تسمح هذه الخدمة للنصوص البرمجية بتخزين السلاسل كأزواج مفتاح/قيمة على مستوى
نص برمجي واحد أو مستخدم واحد للنص البرمجي أو مستند واحد يتم فيه استخدام
إضافة محرِّر.
لمزيد من المعلومات عن حالات استخدام كل نوع من المواقع، اطّلِع على
دليل خدمة المواقع.
صفوف
الاسم | وصف قصير |
Properties | يعمل عنصر "الخصائص" كواجهة للوصول إلى خصائص المستخدِم أو المستند أو النص البرمجي. |
PropertiesService | يسمح للنصوص البرمجية بتخزين بيانات بسيطة في أزواج مفتاح/قيمة على مستوى نص برمجي واحد أو مستخدم واحد لنص برمجي أو مستند واحد يتم فيه استخدام إحدى الإضافات. |
ScriptProperties
| سمات النصوص البرمجية هي أزواج مفتاح/قيمة يخزّنها نص برمجي في مساحة تخزين دائمة. |
UserProperties
| خصائص المستخدِمين هي أزواج مفتاح/قيمة فريدة للمستخدِم. |
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe Properties Service allows scripts to store data as key-value pairs, with different scopes available: script, user, or document.\u003c/p\u003e\n"],["\u003cp\u003eThis service offers classes for managing properties like Properties, PropertiesService, ScriptProperties, and UserProperties, each with its own specific purpose.\u003c/p\u003e\n"],["\u003cp\u003eProperties can be manipulated with methods such as deleting, retrieving by key or in bulk, and setting new values.\u003c/p\u003e\n"],["\u003cp\u003eDifferent property stores can be accessed, including document-specific, script-wide, or user-specific stores, through the PropertiesService class.\u003c/p\u003e\n"]]],[],null,["# Properties Service\n\nProperties\n\nThis service allows scripts to store strings as key-value pairs scoped to\none script, one user of a script, or one document in which an\n[editor add-on](/gsuite/add-ons/concepts/types#editor_add-ons) is used.\nFor more information about when to use each type of property, see the\n[guide to the Properties service](/apps-script/guides/properties).\n\nClasses\n-------\n\n| Name | Brief description |\n|---------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Properties](/apps-script/reference/properties/properties) | The properties object acts as the interface to access user, document, or script properties. |\n| [PropertiesService](/apps-script/reference/properties/properties-service) | Allows scripts to store simple data in key-value pairs scoped to one script, one user of a script, or one document in which an add-on is used. |\n| [ScriptProperties](/apps-script/reference/properties/script-properties) | Script Properties are key-value pairs stored by a script in a persistent store. |\n| [UserProperties](/apps-script/reference/properties/user-properties) | User Properties are key-value pairs unique to a user. |\n\n[Properties](/apps-script/reference/properties/properties)\n----------------------------------------------------------\n\n### Methods\n\n| Method | Return type | Brief description |\n|--------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [deleteAllProperties()](/apps-script/reference/properties/properties#deleteAllProperties()) | [Properties](/apps-script/reference/properties/properties) | Deletes all properties in the current `Properties` store. |\n| [deleteProperty(key)](/apps-script/reference/properties/properties#deleteProperty(String)) | [Properties](/apps-script/reference/properties/properties) | Deletes the property with the given key in the current `Properties` store. |\n| [getKeys()](/apps-script/reference/properties/properties#getKeys()) | `String[]` | Gets all keys in the current `Properties` store. |\n| [getProperties()](/apps-script/reference/properties/properties#getProperties()) | `Object` | Gets a copy of all key-value pairs in the current `Properties` store. |\n| [getProperty(key)](/apps-script/reference/properties/properties#getProperty(String)) | `String` | Gets the value associated with the given key in the current `Properties` store, or `null` if no such key exists. |\n| [setProperties(properties)](/apps-script/reference/properties/properties#setProperties(Object)) | [Properties](/apps-script/reference/properties/properties) | Sets all key-value pairs from the given object in the current `Properties` store. |\n| [setProperties(properties, deleteAllOthers)](/apps-script/reference/properties/properties#setProperties(Object,Boolean)) | [Properties](/apps-script/reference/properties/properties) | Sets all key-value pairs from the given object in the current `Properties` store, optionally deleting all other properties in the store. |\n| [setProperty(key, value)](/apps-script/reference/properties/properties#setProperty(String,String)) | [Properties](/apps-script/reference/properties/properties) | Sets the given key-value pair in the current `Properties` store. |\n\n[PropertiesService](/apps-script/reference/properties/properties-service)\n-------------------------------------------------------------------------\n\n### Methods\n\n| Method | Return type | Brief description |\n|---------------------------------------------------------------------------------------------------------|------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|\n| [getDocumentProperties()](/apps-script/reference/properties/properties-service#getDocumentProperties()) | [Properties](/apps-script/reference/properties/properties) | Gets a property store (for this script only) that all users can access within the open document, spreadsheet, or form. |\n| [getScriptProperties()](/apps-script/reference/properties/properties-service#getScriptProperties()) | [Properties](/apps-script/reference/properties/properties) | Gets a property store that all users can access, but only within this script. |\n| [getUserProperties()](/apps-script/reference/properties/properties-service#getUserProperties()) | [Properties](/apps-script/reference/properties/properties) | Gets a property store that only the current user can access, and only within this script. |\n\n[ScriptProperties](/apps-script/reference/properties/script-properties)\n-----------------------------------------------------------------------\n\n[UserProperties](/apps-script/reference/properties/user-properties)\n-------------------------------------------------------------------"]]