সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
বৈশিষ্ট্য পরিষেবা আপনাকে একটি স্ক্রিপ্ট, একটি স্ক্রিপ্টের একজন ব্যবহারকারী, বা একটি নথিতে যেখানে একটি অ্যাড-অন ব্যবহার করা হয়, কী-মানের জোড়ায় সহজ ডেটা সঞ্চয় করতে দেয়৷ এটি সাধারণত ডেভেলপার কনফিগারেশন বা ব্যবহারকারীর পছন্দ সংরক্ষণ করতে ব্যবহৃত হয়। বৈশিষ্ট্য স্ক্রিপ্ট মধ্যে ভাগ করা হয় না.
PropertiesService গ্লোবাল অবজেক্ট তিনটি পদ্ধতি অফার করে, যার প্রত্যেকটি একই ধরনের Properties অবজেক্ট প্রদান করে কিন্তু বিভিন্ন অ্যাক্সেস অধিকার সহ, যা নিম্নলিখিত টেবিলে দেখানো হয়েছে:
একটি স্ক্রিপ্ট, অ্যাড-অন, বা ওয়েব অ্যাপের সমস্ত ব্যবহারকারী৷
স্ক্রিপ্ট, অ্যাড-অন বা ওয়েব অ্যাপের বর্তমান ব্যবহারকারী
খোলা নথিতে একটি অ্যাড-অনের সমস্ত ব্যবহারকারী
সাধারণত এর জন্য ব্যবহৃত হয়
অ্যাপ-ব্যাপী কনফিগারেশন ডেটা, যেমন ডেভেলপারের বাহ্যিক ডাটাবেসের জন্য ব্যবহারকারীর নাম এবং পাসওয়ার্ড
ব্যবহারকারী-নির্দিষ্ট সেটিংস, যেমন মেট্রিক বা ইম্পেরিয়াল ইউনিট
ডকুমেন্ট-নির্দিষ্ট ডেটা, যেমন একটি এমবেডেড চার্টের জন্য উৎস URL
ডেটা বিন্যাস
বৈশিষ্ট্য পরিষেবা কী-মান জোড়ায় স্ট্রিং হিসাবে সমস্ত ডেটা সঞ্চয় করে। ডেটা প্রকারগুলি যেগুলি ইতিমধ্যে স্ট্রিং নয় সেগুলি স্বয়ংক্রিয়ভাবে স্ট্রিংগুলিতে রূপান্তরিত হয়, সংরক্ষিত বস্তুগুলির মধ্যে থাকা পদ্ধতিগুলি সহ৷
try{// Set a property in each of the three property stores.constscriptProperties=PropertiesService.getScriptProperties();constuserProperties=PropertiesService.getUserProperties();constdocumentProperties=PropertiesService.getDocumentProperties();scriptProperties.setProperty('SERVER_URL','http://www.example.com/');userProperties.setProperty('DISPLAY_UNITS','metric');documentProperties.setProperty('SOURCE_DATA_ID','1j3GgabZvXUF177W0Zs_2v--H6SPCQb4pmZ6HsTZYT5k');}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
প্রচুর পরিমাণে ডেটা সংরক্ষণ করতে, কী-মানের জোড়াগুলির একটি মানচিত্র Properties.setProperties(properties) এ পাস করুন। প্যারামিটারে বস্তুর প্রতিটি কী-মান জোড়া একটি পৃথক সম্পত্তি হিসাবে সংরক্ষণ করা হয়:
try{// Set multiple script properties in one call.constscriptProperties=PropertiesService.getScriptProperties();scriptProperties.setProperties({'cow':'moo','sheep':'baa','chicken':'cluck'});}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
try{// Get the value for the user property 'DISPLAY_UNITS'.constuserProperties=PropertiesService.getUserProperties();constunits=userProperties.getProperty('DISPLAY_UNITS');console.log('values of units %s',units);}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
try{// Get multiple script properties in one call, then log them all.constscriptProperties=PropertiesService.getScriptProperties();constdata=scriptProperties.getProperties();for(constkeyindata){console.log('Key: %s, Value: %s',key,data[key]);}}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
তথ্য পরিবর্তন
getProperty() এবং getProperties() পদ্ধতিগুলি সঞ্চিত ডেটার একটি অনুলিপি ফেরত দেয়, একটি লাইভ ভিউ নয়, তাই প্রত্যাবর্তিত বস্তুটি পরিবর্তন করলে সম্পত্তি স্টোরের মান আপডেট হবে না। স্টোরে ডেটা আপডেট করতে, এটি আবার সংরক্ষণ করুন:
try{// Change the unit type in the user property 'DISPLAY_UNITS'.constuserProperties=PropertiesService.getUserProperties();letunits=userProperties.getProperty('DISPLAY_UNITS');units='imperial';// Only changes local value, not stored value.userProperties.setProperty('DISPLAY_UNITS',units);// Updates stored value.}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
try{// Delete the user property 'DISPLAY_UNITS'.constuserProperties=PropertiesService.getUserProperties();userProperties.deleteProperty('DISPLAY_UNITS');}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
try{// Get user properties in the current script.constuserProperties=PropertiesService.getUserProperties();// Delete all user properties in the current script.userProperties.deleteAllProperties();}catch(err){// TODO (developer) - Handle exceptionconsole.log('Failed with error %s',err.message);}
ম্যানুয়ালি স্ক্রিপ্ট বৈশিষ্ট্য পরিচালনা করুন
আপনি প্রজেক্ট সেটিংস পৃষ্ঠা থেকে কী-মানের জোড়ায় স্ট্রিং হিসাবে ম্যানুয়ালি পঞ্চাশটি পর্যন্ত কাস্টম বৈশিষ্ট্য যোগ করতে পারেন। পঞ্চাশটিরও বেশি বৈশিষ্ট্য যোগ করতে, ডেটা সংরক্ষণে উপরে বর্ণিত পদ্ধতিগুলি ব্যবহার করে আপনাকে প্রোগ্রাম্যাটিকভাবে সেগুলি যোগ করতে হবে। আপনি যখন প্রকল্প সেটিংস পৃষ্ঠা থেকে স্ক্রিপ্ট বৈশিষ্ট্য সেট করেন, আপনি স্ক্রিপ্ট ভেরিয়েবল উল্লেখ করতে পারবেন না।
স্ক্রিপ্ট বৈশিষ্ট্য যোগ করুন
আপনার Apps স্ক্রিপ্ট প্রকল্প খুলুন.
বাম দিকে, প্রকল্প সেটিংস ক্লিক করুন .
প্রথম সম্পত্তি যোগ করতে, স্ক্রিপ্ট বৈশিষ্ট্যের অধীনে স্ক্রিপ্ট বৈশিষ্ট্য যোগ করুন ক্লিক করুন।
দ্বিতীয় এবং পরবর্তী বৈশিষ্ট্য যোগ করতে, স্ক্রিপ্ট বৈশিষ্ট্যের অধীনে স্ক্রিপ্ট বৈশিষ্ট্য সম্পাদনা করুন>স্ক্রিপ্ট বৈশিষ্ট্য যোগ করুন ক্লিক করুন।
সম্পত্তির জন্য, কী নাম লিখুন।
মান- এর জন্য, কী-এর মান লিখুন।
(ঐচ্ছিক) আরও বৈশিষ্ট্য যোগ করতে, স্ক্রিপ্ট বৈশিষ্ট্য যোগ করুন ক্লিক করুন।
স্ক্রিপ্ট বৈশিষ্ট্য সংরক্ষণ করুন ক্লিক করুন.
স্ক্রিপ্ট বৈশিষ্ট্য সম্পাদনা করুন
আপনার Apps স্ক্রিপ্ট প্রকল্প খুলুন.
বাম দিকে, প্রকল্প সেটিংস ক্লিক করুন .
স্ক্রিপ্ট বৈশিষ্ট্যের অধীনে, স্ক্রিপ্ট বৈশিষ্ট্য সম্পাদনা করুন ক্লিক করুন।
আপনি পরিবর্তন করতে চান প্রতিটি সম্পত্তির জন্য মূল নাম এবং মূল মান পরিবর্তন করুন.
স্ক্রিপ্ট বৈশিষ্ট্য সংরক্ষণ করুন ক্লিক করুন.
স্ক্রিপ্ট বৈশিষ্ট্য মুছুন
আপনার Apps স্ক্রিপ্ট প্রকল্প খুলুন.
বাম দিকে, প্রকল্প সেটিংস ক্লিক করুন .
স্ক্রিপ্ট বৈশিষ্ট্যের অধীনে, স্ক্রিপ্ট বৈশিষ্ট্য সম্পাদনা ক্লিক করুন।
আপনি যে সম্পত্তিটি মুছতে চান তার পাশে, Remove close ক্লিক করুন।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Properties service allows you to store simple data as key-value pairs, with separate stores for script, user, and document properties.\u003c/p\u003e\n"],["\u003cp\u003eData is stored as strings and automatically converted if it's a different data type, with access varying depending on the chosen property store.\u003c/p\u003e\n"],["\u003cp\u003eYou can save, read, modify, and delete data within these property stores using specific methods provided by the Properties service.\u003c/p\u003e\n"],["\u003cp\u003eScript properties can also be managed manually through the project settings page for a limited number of custom properties.\u003c/p\u003e\n"]]],[],null,["# Properties Service\n\nThe [Properties service](/apps-script/reference/properties) lets you store\nsimple data in key-value pairs scoped to one script, one user of a script, or\none document in which an [add-on](/workspace/add-ons/overview) is used. It is\ntypically used to store developer configuration or user preferences. Properties\nare never shared between scripts.\n\nTo view the daily quotas and storage limits for the Properties service, see\n[Quotas for Google Services](/apps-script/guides/services/quotas).\n\nComparison of property stores\n-----------------------------\n\nThe\n[`PropertiesService`](/apps-script/reference/properties/properties-service)\nglobal object offers three methods, each of which returns a similar\n[`Properties`](/apps-script/reference/properties/properties)\nobject but with different access rights, as shown in the following table:\n\n| | Script Properties | User Properties | Document Properties |\n|--------------------|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| Method to access | [getScriptProperties()](/apps-script/reference/properties/properties-service#getScriptProperties()) | [getUserProperties()](/apps-script/reference/properties/properties-service#getUserProperties()) | [getDocumentProperties()](/apps-script/reference/properties/properties-service#getDocumentProperties()) |\n| Data shared among | All users of a script, add-on, or web app | The current user of a script, add-on, or web app | All users of an add-on in the open document |\n| Typically used for | App-wide configuration data, like the username and password for the developer's external database | User-specific settings, like metric or imperial units | Document-specific data, like the source URL for an embedded chart |\n\nData format\n-----------\n\nThe Properties service stores all data as strings in key-value pairs. Data types\nthat are not already strings are automatically converted to strings, including\nmethods contained within saved objects.\n\nSaving data\n-----------\n\nTo save a single value, call the method [`Properties.setProperty(key,\nvalue)`](/apps-script/reference/properties/properties#setProperty(String,String))\nof the appropriate store, as shown in the following example: \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Set a property in each of the three property stores.\n const scriptProperties = PropertiesService.getScriptProperties();\n const userProperties = PropertiesService.getUserProperties();\n const documentProperties = PropertiesService.getDocumentProperties();\n\n scriptProperties.setProperty('SERVER_URL', 'http://www.example.com/');\n userProperties.setProperty('DISPLAY_UNITS', 'metric');\n documentProperties.setProperty('SOURCE_DATA_ID',\n '1j3GgabZvXUF177W0Zs_2v--H6SPCQb4pmZ6HsTZYT5k');\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nTo save data in bulk, pass a map of key-value pairs to\n[`Properties.setProperties(properties)`](/apps-script/reference/properties/properties#setProperties(Object)).\nEach key-value pair of the object in the parameter is stored as a separate\nproperty: \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Set multiple script properties in one call.\n const scriptProperties = PropertiesService.getScriptProperties();\n scriptProperties.setProperties({\n 'cow': 'moo',\n 'sheep': 'baa',\n 'chicken': 'cluck'\n });\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nReading data\n------------\n\nTo retrieve a single value that you have previously saved, call\n[`Properties.getProperty(key)`](/apps-script/reference/properties/properties#getProperty(String)): \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Get the value for the user property 'DISPLAY_UNITS'.\n const userProperties = PropertiesService.getUserProperties();\n const units = userProperties.getProperty('DISPLAY_UNITS');\n console.log('values of units %s', units);\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nTo retrieve all values in the current property store, call\n[`Properties.getProperties()`](/apps-script/reference/properties/properties#getProperties()): \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Get multiple script properties in one call, then log them all.\n const scriptProperties = PropertiesService.getScriptProperties();\n const data = scriptProperties.getProperties();\n for (const key in data) {\n console.log('Key: %s, Value: %s', key, data[key]);\n }\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nModifying data\n--------------\n\nThe methods `getProperty()` and `getProperties()` return a copy of the stored\ndata, not a live view, so changing the returned object will not update the value\nin the property store. To update the data in the store, simply save it again: \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Change the unit type in the user property 'DISPLAY_UNITS'.\n const userProperties = PropertiesService.getUserProperties();\n let units = userProperties.getProperty('DISPLAY_UNITS');\n units = 'imperial'; // Only changes local value, not stored value.\n userProperties.setProperty('DISPLAY_UNITS', units); // Updates stored value.\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nDeleting data\n-------------\n\nTo delete a single value, call\n[`Properties.deleteProperty(key)`](/apps-script/reference/properties/properties#deleteProperty(String)): \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Delete the user property 'DISPLAY_UNITS'.\n const userProperties = PropertiesService.getUserProperties();\n userProperties.deleteProperty('DISPLAY_UNITS');\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nTo delete all properties in the current store, call\n[`Properties.deleteAllProperties()`](/apps-script/reference/properties/properties#deleteAllProperties()): \nservice/propertyService.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/service/propertyService.gs) \n\n```javascript\ntry {\n // Get user properties in the current script.\n const userProperties = PropertiesService.getUserProperties();\n // Delete all user properties in the current script.\n userProperties.deleteAllProperties();\n} catch (err) {\n // TODO (developer) - Handle exception\n console.log('Failed with error %s', err.message);\n}\n```\n\nManage script properties manually\n---------------------------------\n\nYou can manually add up to fifty custom properties, as strings in key-value\npairs, from the project settings page. To add more than fifty properties, you\nneed to add them programmatically using the methods described above in\n[Saving data](#saving-data).\nWhen you set script properties from the project settings page, you can't\nreference script variables.\n\n### Add script properties\n\n1. Open your Apps Script project.\n2. At the left, click **Project Settings** .\n3. To add the first property, under **Script Properties** click **Add script property**.\n4. To add second and subsequent properties, under **Script Properties** click **Edit script properties** \\\u003e **Add script property**.\n5. For **Property**, enter the key name.\n6. For **Value**, enter the value for the key.\n7. (Optional) To add more properties, click **Add script property**.\n8. Click **Save script properties**.\n\n### Edit script properties\n\n1. Open your Apps Script project.\n2. At the left, click **Project Settings** .\n3. Under **Script Properties** , click **Edit script properties**.\n4. Make changes to the key name and key value for each property you want to change.\n5. Click **Save script properties**.\n\n### Delete script properties\n\n1. Open your Apps Script project.\n2. At the left, click **Project Settings** .\n3. Under **Script Properties** , click **Edit script properties**.\n4. Next to the property that you want to delete, click Remove close.\n5. Click **Save script properties**."]]