ধাপে ধাপে কনফিগারেশন
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
স্টেপড কনফিগারেশন একটি সংযোগকারীকে ব্যবহারকারী-প্রদত্ত উত্তরগুলির উপর ভিত্তি করে সংযোগকারী কনফিগারেশনকে গতিশীলভাবে পপুলেট করার অনুমতি দেয়। উদাহরণস্বরূপ, একটি "রাজ্য" ড্রপডাউন নির্বাচন করার পরে একটি "শহর" ড্রপডাউন তৈরি করা।
প্রয়োজনীয়তা
এই নির্দেশিকা অনুমান করে আপনি ইতিমধ্যেই কমিউনিটি সংযোগকারী কনফিগারেশনের সাথে পরিচিত৷ একটি রিফ্রেশার জন্য getConfig এর মাধ্যমে কনফিগারেশন সংজ্ঞায়িত দেখুন।
ওভারভিউ
স্টেপড কনফিগারেশনে রয়েছে Looker Studio কল করা getConfig()
একাধিকবার, এবং আপনার কানেক্টর প্রতিবার আরও কনফিগারেশন প্রশ্ন ফেরত দেয়। getConfig()
এর প্রতিটি কলে ব্যবহারকারীর শেষ getConfig()
প্রতিক্রিয়ার উত্তর অন্তর্ভুক্ত থাকবে। যতক্ষণ না আপনি setIsSteppedConfig(true)
দিয়ে একটি প্রতিক্রিয়া ফেরত দেন ততক্ষণ এই প্রক্রিয়াটি অব্যাহত থাকে।
নির্দেশিকা
- কনফিগারেশন সম্পূর্ণ না হওয়া পর্যন্ত
setIsSteppedConfig(true)
সেট করুন - যতক্ষণ পর্যন্ত
setIsSteppedConfig(true)
সেট থাকে ততক্ষণ Looker Studio বারবার getConfig()
কল করবে। কনফিগারেশন সম্পূর্ণ হলে, চূড়ান্ত getConfig()
প্রতিক্রিয়া setIsSteppedConfig(false)
সেট করা উচিত। - কনফিগারেশন প্রশ্নগুলির জন্য
isDynamic(true)
সেট করুন যা পরবর্তী প্রশ্নগুলি নির্ধারণ করে - যদি
isDynamic
চিহ্নিত একটি ক্ষেত্র ব্যবহারকারী দ্বারা পরিবর্তিত হয়, তাহলে পরবর্তী কনফিগারেশন এন্ট্রিগুলি UI এ সাফ করা হবে এবং ব্যবহারকারীকে পরবর্তী সমস্ত ধাপগুলি কনফিগার করতে হবে৷ এটি নিশ্চিত করতে সহায়তা করে যে ব্যবহারকারীরা আপনাকে একটি অবৈধ কনফিগারেশন পাঠাবেন না। - ব্যবহারকারী-প্রদত্ত উত্তরগুলি
request.configParams
এর মাধ্যমে পাস করা হবে। request.configParams
আপনার সংযোগকারীর প্রথম getConfig()
অনুরোধের জন্য undefined
হবে। পরবর্তী অনুরোধে ব্যবহারকারী-প্রদত্ত উত্তরগুলিকে কনফিগারেশন আইডি দ্বারা চাবিকৃত অবজেক্ট হিসাবে অন্তর্ভুক্ত করা হবে বা ব্যবহারকারী কোনো উত্তর না দিলে undefined
।
উদাহরণ:
{
state: 'CA',
city: 'mountain_view'
}
- কনফিগারেশন যোগ করা হয়
বিদ্যমান প্রশ্নগুলির পরে নতুন কনফিগারেশন প্রশ্ন যোগ করা উচিত।
- কনফিগারেশন পরিবর্তন করা যাবে না
যদি একটি কনফিগারেশন প্রশ্ন আগে জিজ্ঞাসা করা হয়, এটি পরবর্তী সমস্ত কলের জন্য উপস্থিত থাকা উচিত। উদাহরণস্বরূপ, যদি getConfig()
এ প্রথম কলে কনফিগারেশন প্রশ্ন A জিজ্ঞাসা করা হয়, তাহলে ভবিষ্যতের সমস্ত প্রতিক্রিয়াতে A অন্তর্ভুক্ত করা উচিত।
- কনফিগারেশন অদম্য হয়
একই configParams
সাথে getConfig()
এ করা কল একই কনফিগারেশন ফেরত দিতে হবে।
- গতিশীল পরামিতি ওভাররাইডযোগ্য হতে পারে না
লুকার স্টুডিও ডায়নামিক কনফিগারেশন প্যারামিটার ওভাররাইড করার অনুমতি দেবে না।
উদাহরণ কনফিগারেশন
গতিশীল ড্রপডাউন
এই প্রথম প্রশ্নটি একজন ব্যবহারকারীকে একটি রাজ্য নির্বাচন করতে অনুরোধ করে, তারপরে নির্বাচিত রাজ্যের উপর ভিত্তি করে গতিশীলভাবে একটি শহরের ড্রপডাউন প্রদান করে।
var cc = DataStudioApp.createCommunityConnector();
function optionsForState(state) {
switch (state) {
case "IL": {
return [["Chicago", "chicago"], ["Springfield", "springfield"]];
}
case "CA": {
return [["Mountain View", "mountain_view"], ["Los Angeles", "los_angeles"]];
}
default: {
cc.newUserError()
.setText('You must either select "IL" or "CA"')
.throwException();
}
}
}
function getConfig(request) {
var configParams = request.configParams;
var isFirstRequest = configParams === undefined;
var config = cc.getConfig();
if (isFirstRequest) {
config.setIsSteppedConfig(true);
}
config.newSelectSingle()
.setId("state")
.setName("State")
// Set isDynamic to true so any changes to State will clear the city
// selections.
.setIsDynamic(true)
.addOption(config.newOptionBuilder().setLabel("Illinois").setValue("IL"))
.addOption(config.newOptionBuilder().setLabel("California").setValue("CA"));
if (!isFirstRequest) {
var city = config.newSelectSingle()
.setId("city")
.setName("City");
var cityOptions = optionsForState(configParams.state);
cityOptions.forEach(function(labelAndValue) {
var cityLabel = labelAndValue[0];
var cityValue = labelAndValue[1];
city.addOption(config.newOptionBuilder().setLabel(cityLabel).setValue(cityValue));
});
}
return config.build();
}
শাখা পথ
নির্বাচিত "দেশ" "USA" হলে এটি একটি অতিরিক্ত প্রশ্ন জিজ্ঞাসা করবে।
var cc = DataStudioApp.createCommunityConnector();
function getConfig(request) {
var configParams = request.configParams;
var isFirstRequest = configParams === undefined;
var config = cc.getConfig();
if (isFirstRequest) {
config.setIsSteppedConfig(true);
}
config
.newSelectSingle()
.setId('country')
.setName('Country')
// Set isDynamic to true so any changes to Country will clear the state
// selections.
.setIsDynamic(true)
.addOption(config.newOptionBuilder().setLabel('United States').setValue('USA'))
.addOption(config.newOptionBuilder().setLabel('Canada').setValue('CA'));
if (!isFirstRequest) {
// validate a valid value was selected for configParams.country
if (configParams.country === undefined) {
cc.newUserError().setText('You must choose a country.').throwException();
}
switch (configParams.country) {
case 'USA': {
config
.newSelectSingle()
.setId('state')
.setName('State')
.addOption(config.newOptionBuilder().setLabel('New York').setValue('NY'))
.addOption(config.newOptionBuilder().setLabel('Calfornia').setValue('CA'));
break;
}
case 'CA': {
// No additional configuration is needed for Canada.
break;
}
default: {
cc.newUserError()
.setText('You must either select "CA" or "USA"')
.throwException();
}
}
}
return config.build();
}
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eStepped configuration in Looker Studio connectors allows dynamic population of configuration fields based on user input, such as showing city options after a state is selected.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves Looker Studio repeatedly calling the \u003ccode\u003egetConfig()\u003c/code\u003e function, with the connector providing new configuration questions based on previous answers until the configuration is complete.\u003c/p\u003e\n"],["\u003cp\u003eConfiguration questions influencing later steps should be marked as dynamic using \u003ccode\u003eisDynamic(true)\u003c/code\u003e, ensuring the user reconfigures subsequent steps upon modification.\u003c/p\u003e\n"],["\u003cp\u003eConnectors receive user-provided answers through \u003ccode\u003erequest.configParams\u003c/code\u003e, allowing for conditional logic and tailoring of configuration options.\u003c/p\u003e\n"],["\u003cp\u003eConfigurations should be additive, idempotent (returning the same configuration for identical inputs), and immutable once introduced, with dynamic parameters being non-overridable.\u003c/p\u003e\n"]]],[],null,["# Stepped Configuration\n\nStepped configuration allows a connector to dynamically populate the connector\nconfiguration based on user-provided answers. For example, populating a \"City\"\ndropdown after a \"State\" dropdown is selected.\n\nRequirements\n------------\n\nThis guide assumes you are already familiar with Community Connector\nconfigurations. See [define configuration via getConfig](/looker-studio/connector/build#define_configuration_via_getconfig) for a refresher.\n\nOverview\n--------\n\nStepped configuration consists of Looker Studio calling `getConfig()` multiple\ntimes, and your connector returning more configuration questions each time. Each\ncall to `getConfig()` will include the user's answers to the last `getConfig()`\nresponse. This process is continued as long as you return a response with\n`setIsSteppedConfig(true)`.\n\nGuidelines\n----------\n\nSet `setIsSteppedConfig(true)` until the configuration is complete\n: Looker Studio will repeatedly call `getConfig()` as long as\n `setIsSteppedConfig(true)` is set.Once configuration is complete, the final\n `getConfig()` response should set `setIsSteppedConfig(false)`.\n\nSet `isDynamic(true)` for configuration questions that determine later questions\n: If a field marked `isDynamic` is modified by the user, subsequent\n configuration entries will be cleared in the UI, and the user will need to\n configure all subsequent steps. This helps ensure users don't send you an\n invalid configuration.\n\nUser-provided answers will be passed via `request.configParams`.\n\n: `request.configParams` will be `undefined` for the first `getConfig()`\n request to your connector. Subsequent requests will include the\n user-provided answers as an object keyed by the configuration ids or\n `undefined` if the user doesn't provide any answers.\n\n Example: \n\n {\n state: 'CA',\n city: 'mountain_view'\n }\n\nConfigurations are additive\n\n: New configuration questions should be added after existing ones.\n\nConfigurations cannot be mutated\n\n: If a configuration question was asked previously, it should be present for\n all subsequent calls. For example, if configuration question **A** was asked\n in the first call to `getConfig()`, **A** should be included in all future\n responses.\n\nConfigurations are idempotent\n\n: Calls to `getConfig()` with the same `configParams` should return the same\n configuration.\n\nDynamic parameters cannot be overridable\n\n: Looker Studio will not allow dynamic configuration parameters to be\n [overridden](/looker-studio/connector/data-source-parameters).\n\nExample configurations\n----------------------\n\n### Dynamic dropdowns\n\nThis first question prompts a user to select a state, then dynamically provides\na city dropdown based on the selected state. \n\n var cc = DataStudioApp.createCommunityConnector();\n\n function optionsForState(state) {\n switch (state) {\n case \"IL\": {\n return [[\"Chicago\", \"chicago\"], [\"Springfield\", \"springfield\"]];\n }\n case \"CA\": {\n return [[\"Mountain View\", \"mountain_view\"], [\"Los Angeles\", \"los_angeles\"]];\n }\n default: {\n cc.newUserError()\n .setText('You must either select \"IL\" or \"CA\"')\n .throwException();\n }\n }\n }\n\n function getConfig(request) {\n var configParams = request.configParams;\n var isFirstRequest = configParams === undefined;\n var config = cc.getConfig();\n if (isFirstRequest) {\n config.setIsSteppedConfig(true);\n }\n\n config.newSelectSingle()\n .setId(\"state\")\n .setName(\"State\")\n // Set isDynamic to true so any changes to State will clear the city\n // selections.\n .setIsDynamic(true)\n .addOption(config.newOptionBuilder().setLabel(\"Illinois\").setValue(\"IL\"))\n .addOption(config.newOptionBuilder().setLabel(\"California\").setValue(\"CA\"));\n\n if (!isFirstRequest) {\n var city = config.newSelectSingle()\n .setId(\"city\")\n .setName(\"City\");\n var cityOptions = optionsForState(configParams.state);\n cityOptions.forEach(function(labelAndValue) {\n var cityLabel = labelAndValue[0];\n var cityValue = labelAndValue[1];\n city.addOption(config.newOptionBuilder().setLabel(cityLabel).setValue(cityValue));\n });\n }\n return config.build();\n }\n\n### Branching Paths\n\nThis will ask an additional question if the selected \"Country\" is \"USA\". \n\n var cc = DataStudioApp.createCommunityConnector();\n\n function getConfig(request) {\n var configParams = request.configParams;\n var isFirstRequest = configParams === undefined;\n var config = cc.getConfig();\n if (isFirstRequest) {\n config.setIsSteppedConfig(true);\n }\n\n config\n .newSelectSingle()\n .setId('country')\n .setName('Country')\n // Set isDynamic to true so any changes to Country will clear the state\n // selections.\n .setIsDynamic(true)\n .addOption(config.newOptionBuilder().setLabel('United States').setValue('USA'))\n .addOption(config.newOptionBuilder().setLabel('Canada').setValue('CA'));\n\n if (!isFirstRequest) {\n // validate a valid value was selected for configParams.country\n if (configParams.country === undefined) {\n cc.newUserError().setText('You must choose a country.').throwException();\n }\n switch (configParams.country) {\n case 'USA': {\n config\n .newSelectSingle()\n .setId('state')\n .setName('State')\n .addOption(config.newOptionBuilder().setLabel('New York').setValue('NY'))\n .addOption(config.newOptionBuilder().setLabel('Calfornia').setValue('CA'));\n break;\n }\n case 'CA': {\n // No additional configuration is needed for Canada.\n break;\n }\n default: {\n cc.newUserError()\n .setText('You must either select \"CA\" or \"USA\"')\n .throwException();\n }\n }\n }\n return config.build();\n }"]]