[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eThe ReadPropertySet policy is a standard policy that retrieves property sets and assigns their values to flow variables.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e<ReadPropertySet>\u003c/code\u003e element, which is required, defines the policy and uses \u003ccode\u003e<Read>\u003c/code\u003e child elements to specify property sets, keys, and how the values should be assigned, along with an optional default value if a property set can't be resolved.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003e<IgnoreUnresolvedVariables>\u003c/code\u003e is an optional child element that allows processing to continue if a property set variable cannot be resolved, but this is not applicable when a default value is specified.\u003c/p\u003e\n"],["\u003cp\u003eThe policy can encounter runtime errors, such as \u003ccode\u003esteps.readpropertyset.UnresolvedVariable\u003c/code\u003e, if variables are out of scope or can't be resolved, and deployment errors like \u003ccode\u003esteps.readpropertyset.EmptyReads\u003c/code\u003e if no \u003ccode\u003e<Read>\u003c/code\u003e elements are defined.\u003c/p\u003e\n"],["\u003cp\u003eWhen a ReadPropertySet policy encounters a runtime error, it sets fault variables like \u003ccode\u003efault.name\u003c/code\u003e and \u003ccode\u003ereadpropertyset.POLICY_NAME.failed\u003c/code\u003e, enabling you to trap the error and manage error handling with fault rules.\u003c/p\u003e\n"]]],[],null,["# ReadPropertySet policy\n\nOverview\n--------\n\nThe ReadPropertySet policy reads property sets and populates flow variable with the results.\n\nThis policy is a *Standard policy* and can be deployed to any environment type. For\ninformation on policy types and availability with each environment type, see\n[Policy types](/apigee/docs/api-platform/reference/policies/reference-overview-policy#policy-types).\n\n`\u003cReadPropertySet\u003e` element\n---------------------------\n\nDefines a ReadPropertySet policy.\n\nThe `\u003cReadPropertySet\u003e` element uses the following syntax: \n\n### Syntax\n\nThe `\u003cReadPropertySet\u003e` element uses the following syntax: \n\n```gdscript\n\u003cReadPropertySet name=\"read-property-set\"\u003e\n \u003cRead\u003e\n \u003cName ref=\"set-ref\"\u003eproperty-set-name\u003c/Name\u003e\n \u003cKey ref=\"key-ref\"\u003ekey-name\u003c/Key\u003e\n \u003cAssignTo\u003evar1\u003c/AssignTo\u003e\n \u003cDefaultValue\u003edefault-value\u003c/DefaultValue\u003e\n \u003c/Read\u003e\n ...\n \u003cIgnoreUnresolvedVariables\u003etrue\u003c/IgnoreUnresolvedVariables\u003e\n\u003c/ReadPropertySet\u003e\n```\n\n### Default Policy\n\nThe following example shows the default settings when you add a ReadPropertySet policy\nto your flow in the Apigee UI: \n\n```gdscript\n\u003cReadPropertySet name=\"read-property-set\"\u003e\n \u003cRead\u003e\n \u003cName ref=\"set-ref\"\u003eproperty-set-name\u003c/Name\u003e\n \u003cKey ref=\"key-ref\"\u003ekey-name\u003c/Key\u003e\n \u003cAssignTo\u003evar1\u003c/AssignTo\u003e\n \u003cDefaultValue\u003edefault-value\u003c/DefaultValue\u003e\n \u003c/Read\u003e\n \u003cIgnoreUnresolvedVariables\u003etrue\u003c/IgnoreUnresolvedVariables\u003e\n\u003c/ReadPropertySet\u003e\n```\n\nWhen you insert a new ReadPropertySet policy in the Apigee UI, the template contains stubs for all\npossible operations. See below for information on required elements.\n\nThis element has the following attributes that are common to all policies:\n\nThe following table provides a high level description of the child elements of\n[`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset):\n\nExample\n-------\n\nThis section provides an example using [`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset). \n\n### Example\n\nThis example uses [`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset) to get\n`propertyset.environment.name.request.headers.api-version` and\nassign it to `target_url`. If the property set value isn't obtained,\n`https://httpbin.org/get` is used instead. \n\n```scdoc\n\u003cReadPropertySet name=\"read-property-set\"\u003e\n \u003cRead\u003e\n \u003cName ref=\"set-ref\"\u003eenvironment.name\u003c/Name\u003e\n \u003cKey ref=\"key-ref\"\u003erequest.headers.api-version\u003c/Key\u003e\n \u003cAssignTo\u003etarget_url\u003c/AssignTo\u003e\n \u003cDefaultValue\u003ehttps://httpbin.org/get\u003c/DefaultValue\u003e\n \u003c/Read\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e \n\u003c/ReadPropertySet\u003e\n```\n\nChild element reference\n-----------------------\n\nThis section describes the child elements of [`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset).\n\n### `\u003cRead\u003e`\n\nResolves a property set variable and sets the result in a flow variable.\n\nThe `\u003cRead\u003e` element specifes the property set variable to resolve and the flow variable to\nset that value to. It also includes an optional default value, which is used in the event of an\nunresolved property set. You can include multiple `\u003cRead\u003e` elements in a single [`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset) policy.\n\nThe `\u003cRead\u003e` element uses the following syntax: \n\n### Syntax\n\n```gdscript\n\u003cRead\u003e\n \u003cName ref=\"set-ref\"\u003eproperty-set-name\u003c/Name\u003e\n \u003cKey ref=\"key-ref\"\u003ekey-name\u003c/Key\u003e\n \u003cAssignTo\u003evar1\u003c/AssignTo\u003e\n \u003cDefaultValue\u003edefault-value\u003c/DefaultValue\u003e\n\u003c/Read\u003e\n```\n\n### Example\n\nThis example uses [`\u003cReadPropertySet\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#readpropertyset) to get\n`propertyset.environment.name.request.headers.api-version` and\nassign it to `target_url`. If the property set value isn't obtained,\n`https://httpbin.org/get` is used instead. \n\n```scdoc\n\u003cReadPropertySet name=\"read-property-set\"\u003e\n \u003cRead\u003e\n \u003cName ref=\"environment.name\"\u003emy-property-set-name\u003c/Name\u003e\n \u003cKey ref=\"request.headers.api-version\"\u003emy-property-set-key\u003c/Key\u003e\n \u003cAssignTo\u003etarget_url\u003c/AssignTo\u003e\n \u003cDefaultValue\u003ehttps://httpbin.org/get\u003c/DefaultValue\u003e\n \u003c/Read\u003e\n \u003cIgnoreUnresolvedVariables\u003efalse\u003c/IgnoreUnresolvedVariables\u003e\n\u003c/ReadPropertySet\u003e\n```\n\nThe following table provides a high-level description of the child elements of\n[`\u003cRead\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#read).\n\n### \\\u003cIgnoreUnresolvedVariables\\\u003e\n\nDetermines whether processing stops when a property set is unresolved. Set to\n`true` to ignore unresolved variables and continue processing.\n\n`IgnoreUnresolvedVariables` is not applicable when [`\u003cDefaultValue\u003e`](/apigee/docs/api-platform/reference/policies/read-property-set-policy#defaultvalueelement)\nis provided.\n\nError reference\n---------------\n\nThis section describes the fault codes and error messages that are returned and fault\nvariables that are set by Apigee specific to the `\u003cReadPropertySet\u003e` policy.\nThis information is important to know if you are developing fault rules to\nhandle faults. To learn more, see [What you need to know\nabout policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors) and [Handling\nfaults](/apigee/docs/api-platform/fundamentals/fault-handling).\n\n### Runtime errors\n\nThese errors can occur when the policy executes.\n\n### Deployment errors\n\nThese errors can occur when you deploy a proxy containing this policy.\n\n### Fault variables\n\nThese variables are set when this policy triggers an error at runtime. For more information,\nsee [What you\nneed to know about policy errors](/apigee/docs/api-platform/fundamentals/what-you-need-know-about-policy-errors).\n\n### Example error response\n\n**Note:** For error handling, the best practice is to trap the `errorcode` part of the error response. Do not rely on the text in the `faultstring`, because it could change. \n\n```transact-sql\n { \n \"fault\": {\n \"faultstring\": \"ReadPropertySet[RPS-SetResponse]: unable to resolve variable [variable_name]\",\n \"detail\": {\n \"errorcode\": \"steps.readpropertyset.UnresolvedVariable\"\n }\n }\n }\n \n```\n\n### Example fault rule\n\n```text\n \u003cFaultRule name=\"ReadPropertySet Faults\"\u003e\n \u003cStep\u003e\n \u003cName\u003eRPS-CustomSetVariableErrorResponse\u003c/Name\u003e\n \u003cCondition\u003e(fault.name = \"SetVariableFailed\")\u003c/Condition\u003e\n \u003c/Step\u003e\n \u003cCondition\u003e(readpropertyset.failed = true)\u003c/Condition\u003e\n \u003c/FaultRule\u003e\n \n```\n\nSchemas\n-------\n\nEach policy type is defined by an XML schema (`.xsd`). For reference, [policy schemas](https://github.com/apigee/api-platform-samples/tree/master/schemas/policy)\nare available on GitHub."]]