संग्रह की मदद से व्यवस्थित रहें अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
SetCredentialsResponse
Builder का इस्तेमाल करके, अपने स्क्रिप्ट प्रोजेक्ट के लिए setCredentials() रिस्पॉन्स बनाएं.
constcommunityConnector=DataStudioApp.createCommunityConnector();functionsetCredentials(request){constisValid=validateCredentials(request);if(isValid){// store the credentials somewhere.}returncommunityConnector.newSetCredentialsResponse().setIsValid(isValid).build();}functionvalidateCredentials(request){// ...}
इस ऑब्जेक्ट को JSON फ़ॉर्मैट में प्रिंट करता है. यह सिर्फ़ डीबग करने के लिए है.
वापसी का टिकट
String
setIsValid(isValid)
इस SetCredentialsResponse की मान्य स्थिति सेट करता है. अगर अनुरोध में दिए गए क्रेडेंशियल मान्य थे, तो इसे true पर सेट करें. अगर नहीं, तो false पर सेट करें.
[[["समझने में आसान है","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-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eSetCredentialsResponse\u003c/code\u003e helps you create a response for your script project's \u003ccode\u003esetCredentials()\u003c/code\u003e function, indicating whether the provided credentials are valid.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003esetIsValid()\u003c/code\u003e method to set the validation status (true/false) and \u003ccode\u003ebuild()\u003c/code\u003e to finalize and return the response object in the required format for Data Studio.\u003c/p\u003e\n"],["\u003cp\u003eFor debugging, \u003ccode\u003eprintJson()\u003c/code\u003e prints the JSON representation of the \u003ccode\u003eSetCredentialsResponse\u003c/code\u003e object.\u003c/p\u003e\n"]]],[],null,["SetCredentialsResponse\n\nBuilder to create a `set``Credentials()` response for your script project.\n\n```javascript\nconst communityConnector = DataStudioApp.createCommunityConnector();\n\nfunction setCredentials(request) {\n const isValid = validateCredentials(request);\n\n if (isValid) {\n // store the credentials somewhere.\n }\n\n return communityConnector.newSetCredentialsResponse().setIsValid(isValid).build();\n}\n\nfunction validateCredentials(request) {\n // ...\n}\n``` \n\nMethods\n\n| Method | Return type | Brief description |\n|---------------------------------------------|-----------------------------|---------------------------------------------------------------------------|\n| [build()](#build()) | `Object` | Validates this object and returns it in the format needed by Data Studio. |\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setIsValid(isValid)](#setIsValid(Boolean)) | [SetCredentialsResponse](#) | Sets the valid status of this [SetCredentialsResponse](#). |\n\nDetailed documentation \n\n`build()` \nValidates this object and returns it in the format needed by Data Studio.\n\nReturn\n\n\n`Object` --- The validated [SetCredentialsResponse](#) object.\n\n*** ** * ** ***\n\n`print``Json()` \nPrints the JSON representation of this object. This is for debugging only.\n\nReturn\n\n\n`String`\n\n*** ** * ** ***\n\n`set``Is``Valid(isValid)` \nSets the valid status of this [SetCredentialsResponse](#). Set to `true` if the\ncredentials provided in the request were valid, `false`, otherwise.\n\nParameters\n\n| Name | Type | Description |\n|-------------|-----------|--------------------------|\n| `is``Valid` | `Boolean` | The valid status to set. |\n\nReturn\n\n\n[SetCredentialsResponse](#) --- This builder, for chaining."]]