Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
PropertiesService
Komut dosyalarının basit verileri bir komut dosyasına, komut dosyasının bir kullanıcısına veya eklenti kullanılan bir dokümana özel anahtar/değer çiftlerinde depolamasına olanak tanır. Özellikler komut dosyaları arasında paylaşılamaz.
Her mülk türünün ne zaman kullanılacağı hakkında daha fazla bilgi için Özellikler hizmet kılavuzuna bakın.
// Sets three properties of different types.constdocumentProperties=PropertiesService.getDocumentProperties();constscriptProperties=PropertiesService.getScriptProperties();constuserProperties=PropertiesService.getUserProperties();documentProperties.setProperty('DAYS_TO_FETCH','5');scriptProperties.setProperty('SERVER_URL','http://www.example.com/MyWeatherService/',);userProperties.setProperty('DISPLAY_UNITS','metric');
Yalnızca mevcut kullanıcının erişebileceği ve yalnızca bu komut dosyası içinde kullanılabilen bir mülk mağazası alır.
Ayrıntılı dokümanlar
getDocumentProperties()
Açık doküman, e-tablo veya formda tüm kullanıcıların erişebileceği bir mülk mağazası (yalnızca bu komut dosyası için) alır. Yalnızca komut dosyası yayınlanmış ve eklenti olarak yürütülüyorsa veya bir Google dosya türüne bağlıysa kullanılabilir. Doküman özellikleri mevcut olmadığında bu yöntem null değerini döndürür. Bir komut dosyası tarafından oluşturulan doküman özelliklerine, aynı dokümana erişen diğer komut dosyaları tarafından bile bu komut dosyası dışından erişilemez.
Return
Properties: Bu komut dosyası için yalnızca geçerli dokümanın tüm kullanıcılarının erişebileceği bir mülk mağazası veya komut dosyası bir eklenti değilse ya da bir Google Workspace dosyasına bağlı değilse null
getScriptProperties()
Tüm kullanıcıların erişebileceği ancak yalnızca bu komut dosyası içinde erişebileceği bir mülk mağazası alır.
Return
Properties: Komut dosyasının tüm kullanıcılarının erişebileceği bir mülk mağazası
getUserProperties()
Yalnızca mevcut kullanıcının erişebileceği ve yalnızca bu komut dosyası içinde kullanılabilen bir mülk mağazası alır.
Return
Properties: Yalnızca komut dosyasının mevcut kullanıcısının erişebileceği bir mülk mağazası
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003eThe Properties Service lets Apps Script store simple data as key-value pairs, with different scopes for scripts, users, and documents.\u003c/p\u003e\n"],["\u003cp\u003eIt offers three methods to access properties: \u003ccode\u003egetDocumentProperties()\u003c/code\u003e, \u003ccode\u003egetScriptProperties()\u003c/code\u003e, and \u003ccode\u003egetUserProperties()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetDocumentProperties()\u003c/code\u003e provides property storage accessible to all users within a specific document, spreadsheet, or form where the script is running.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetScriptProperties()\u003c/code\u003e allows storing properties accessible to all users, but only within the context of the current script.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetUserProperties()\u003c/code\u003e provides a property store specific to the current user and accessible only within the current script.\u003c/p\u003e\n"]]],["The `PropertiesService` stores data in key-value pairs, accessible via `getDocumentProperties`, `getScriptProperties`, and `getUserProperties`. `getDocumentProperties` stores data within a specific document, accessible to all users. `getScriptProperties` stores data within a script, accessible to all users. `getUserProperties` stores data for a single user within a script. The example code demonstrates setting properties using each method: `setProperty`. Each method returns a `Properties` object, which is a property store.\n"],null,[]]