Categories:
  1. What is UI Builder
  2. Create custom workspace
  3. Event Mapping Script – Link to destination
  4. Important UI Builder Component
  5. Enable TAB in Worksapce
  6. UI Action Visible in Workspace
  7. Declarative Actions in ServiceNow
  8. UXF Client Action – Declative Action
  9. Data Management
  10. EVAM Data Resource Dynamic Filter
  11. Custom Component Setup for UI Builder
  12. Concept of Custom Component
  13. Beautiful Table Content
  14. Build Custom Component UI Builder
  15. Call Data Resources From Client Script

Create Properties for Input

createCustomElement('x-1359912-custom-builder', {
	renderer: {type: snabbdom},
	view,
	styles,properties:{text:{default:'[{"number":"INC0000052","stateDisplay":"New"},{"number":"INC0000053","stateDisplay":"In Progress"}]'}
});

Update View Part

const view = (state, {updateState}) => {
	//var title = state.properties.title;
	const {properties:{title}} = state;

	return (
                 <div>
                </div>
             );
}

now-ui.json file update

"uiBuilder": {
        "associatedTypes": [
          "global.core",
          "global.landing-page"
        ],
        "label": "My New Component",
        "tileIcon": "./tile-icon/generic-tile-icon.svg",
        "description": "A description of my component",
        "category": "primitives"
      },
      "actions":[
        {
          "description":"demo",
          "label": "Button Row Click",
          "action":"EVENT_FIRED",
          "payload":[]
        }
      ],
      "properties":[
        {
          "name":"text",
          "label":"Text",
          "fileType":"string"
        }
      ]

Lookup Records JSON Files:

[{"_row_data":{"displayValue":"INC0000060","uniqueValue":"1c741bd70b2322007518478d83673af3"},"short_description":{"value":"demo","displayValue":"demo"},"number":{"value":"INC0000060","displayValue":"INC0000060"},"state":{"value":"7","displayValue":"Closed"}}]

Dispatch Event

const resolve = (number) =>{
		dispatch('EVENT_FIRED', {data: number});
	}

Call dispatch function:

<button className="btn btn-primary" on-click={()=>{
					resolve(rec.number);
				}}>Resolve</button>

Action Handler & Dispatch:

createCustomElement('x-26525-custom-filter', {
	renderer: {type: snabbdom},
	view,actionHandlers:{
		"NOW_DROPDOWN#ITEM_CLICKED":(coeffects)=>{
			//console.log(JSON.stringify(coeffects.action.payload));
			coeffects.dispatch("INCIDENT_FILTER",{data:coeffects.action.payload});
		}
	},

For Loop Array:

{text.map((rec,index) =>{
})}

State Dropdown JSON Mapping

[{id: '1', label: 'New'}, {id: '2', label: 'In Progress'},{id: '3', label: 'On Hold'},{id: '6', label: 'Resolved'}]

Total Views: 1360