Generic Address
← Back to Question Bank
Details
Sample version of the rendered form.
Form Data
What the form data looks like when it is submitted.
{ "street1": "456 Main St", "street2": "Suite 100", "city": "Anytown", "state": "CA", "country": "US", "postalCode": "12345"}CommonGrants Data
What the data looks like translated to the CommonGrants data model using the mapping-to-cg.
{ "street1": "456 Main St", "street2": "Suite 100", "city": "Anytown", "stateOrProvince": "CA", "country": "US", "postalCode": "12345"}JSON Schema
Provides the structure and data validation for this question.
$id: QuestionAddress.yamltype: objectrequired: - street1 - city - state - country - postalCodeexamples: - street1: 456 Main St street2: Suite 100 city: Anytown state: CA country: US postalCode: '12345'description: A generic address question with US state dropdown and conditional state/provincex-ui-schema: type: Group label: Address elements: - type: Control scope: '#/properties/street1' label: Street Address (Line 1) - type: Control scope: '#/properties/street2' label: Street Address (Line 2) - type: Control scope: '#/properties/city' label: City - type: Control scope: '#/properties/state' label: State - type: Control scope: '#/properties/stateOrProvince' label: State or Province rule: effect: SHOW condition: scope: '#/properties/state' schema: pattern: ^Outside the US$ - type: Control scope: '#/properties/country' label: Country - type: Control scope: '#/properties/postalCode' label: Postal Codex-mapping-to-cg: street1: field: street1 street2: field: street2 city: field: city stateOrProvince: field: state country: field: country postalCode: field: postalCodex-mapping-from-cg: street1: field: street1 street2: field: street2 city: field: city state: field: stateOrProvince country: field: country postalCode: field: postalCodex-tags: - addressproperties: street1: type: string description: The primary street address line street2: type: string description: Additional street address information city: type: string description: The city or municipality state: description: The US state, territory, or "Outside the US" $schema: https://json-schema.org/draft/2020-12/schema $id: USState.yaml type: string enum: - AL - AK - AZ - AR - CA - CO - CT - DE - FL - GA - HI - ID - IL - IN - IA - KS - KY - LA - ME - MD - MA - MI - MN - MS - MO - MT - NE - NV - NH - NJ - NM - NY - NC - ND - OH - OK - OR - PA - RI - SC - SD - TN - TX - UT - VT - VA - WA - WV - WI - WY - DC - AS - GU - MP - PR - VI - Outside the US stateOrProvince: type: string description: State or province name (for non-US addresses) country: type: string description: The country postalCode: type: string description: The postal or ZIP codeUI Schema
Describes how to present the question in the form UI.
{ "type": "Group", "label": "Address", "elements": [ { "type": "Control", "scope": "#/properties/street1", "label": "Street Address (Line 1)" }, { "type": "Control", "scope": "#/properties/street2", "label": "Street Address (Line 2)" }, { "type": "Control", "scope": "#/properties/city", "label": "City" }, { "type": "Control", "scope": "#/properties/state", "label": "State" }, { "type": "Control", "scope": "#/properties/stateOrProvince", "label": "State or Province", "rule": { "effect": "SHOW", "condition": { "scope": "#/properties/state", "schema": { "pattern": "^Outside the US$" } } } }, { "type": "Control", "scope": "#/properties/country", "label": "Country" }, { "type": "Control", "scope": "#/properties/postalCode", "label": "Postal Code" } ]}Mapping to CommonGrants
How to translate this question into the CommonGrants ProposalBase data model.
{ "street1": { "field": "street1" }, "street2": { "field": "street2" }, "city": { "field": "city" }, "stateOrProvince": { "field": "state" }, "country": { "field": "country" }, "postalCode": { "field": "postalCode" }}Mapping from CommonGrants
How to pre-fill this question with data from the ProposalBase data model.
{ "street1": { "field": "street1" }, "street2": { "field": "street2" }, "city": { "field": "city" }, "state": { "field": "stateOrProvince" }, "country": { "field": "country" }, "postalCode": { "field": "postalCode" }}