{"id":28227394,"url":"https://github.com/scalable-dynamics/more-xrm","last_synced_at":"2025-07-14T08:32:35.651Z","repository":{"id":57302843,"uuid":"167627580","full_name":"scalable-dynamics/more-xrm","owner":"scalable-dynamics","description":"more-xrm is a TypeScript library that enables you to connect, query and manage Dynamics 365 data using the modern fetch API","archived":false,"fork":false,"pushed_at":"2019-10-10T13:36:12.000Z","size":66,"stargazers_count":6,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-21T01:07:50.025Z","etag":null,"topics":["365","api","dynamics","entity","fetch","fetchxml","metadata","microsoft","odata","powerapps","query","react","typescript","webapi","xrm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scalable-dynamics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T23:27:49.000Z","updated_at":"2024-07-23T05:51:00.000Z","dependencies_parsed_at":"2022-09-20T17:55:02.139Z","dependency_job_id":null,"html_url":"https://github.com/scalable-dynamics/more-xrm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scalable-dynamics/more-xrm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalable-dynamics%2Fmore-xrm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalable-dynamics%2Fmore-xrm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalable-dynamics%2Fmore-xrm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalable-dynamics%2Fmore-xrm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalable-dynamics","download_url":"https://codeload.github.com/scalable-dynamics/more-xrm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalable-dynamics%2Fmore-xrm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265262591,"owners_count":23736422,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["365","api","dynamics","entity","fetch","fetchxml","metadata","microsoft","odata","powerapps","query","react","typescript","webapi","xrm"],"created_at":"2025-05-18T12:11:01.363Z","updated_at":"2025-07-14T08:32:35.643Z","avatar_url":"https://github.com/scalable-dynamics.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://oflow.azurewebsites.net/images/XrmToolsLogo.png\" width=\"250\" /\u003e\u003c/p\u003e\n\n# more-xrm\n\n[![](https://img.shields.io/npm/v/more-xrm.svg)](https://www.npmjs.com/package/more-xrm)\n[![npm](https://img.shields.io/npm/dt/more-xrm.svg)](https://www.npmtrends.com/more-xrm)\n\nCreate more applications using the Microsoft Dynamics 365/XRM platform\n\n**`more-xrm`** is a TypeScript library that enables you to connect, query and manage Dynamics 365 data using the modern fetch api. Query operations and batch procedures are available for connecting to the Dynamics Web API.\n\n\u003e **_more-xrm enables querying the dynamics data model from any application_**\n\n* provides methods for querying and managing Dynamics 365 data\n* introduces **`Query`** interface for describing columns, filters and other query information\n* provides an easy way to retrieve data for a **`Query`**, with formatting and attribute alias names\n* introduces **`Batch`** interface for describing changesets and committing them in batch\n\t* automatically sets related identifiers for parental records created within the same batch\n* provides methods for querying and managing Dynamics 365 Entity Metadata\n* retrieve information about Entities, Attributes and OptionSets in a concise format\n* request metadata for multiple entities and their attributes using a batch operation\n\n## Installation\n\nThis module is designed for use with **[Microsoft Dynamics 365 Customer Engagement Web API](https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/webapi/web-api-types-operations)** - either a Web Resource with a relative api path or an `authToken` with an associated system user record can be used.\n\n**From [unpkg](https://unpkg.com/) (cdn):**\n\n````html\n\u003cscript src=\"https://unpkg.com/more-xrm\"\u003e\u003c/script\u003e\n````\n\n\u003e**_or_**\n\n**From [npm](https://npmjs.com/more-xrm):**\n\n```bash\nnpm install more-xrm\n```\n___\n\n## How to use\n\n1. Import/Add the `dynamics` method from `'more-xrm/dist/Dynamics'`\n\n   \u003e `import dynamics from 'more-xrm/dist/Dynamics';`\n\n2. Import/Add `query` method and `QueryOperator` enum from `'more-xrm/dist/Query'`\n\n   \u003e `import query, { QueryOperator } from 'more-xrm/dist/Query';`\n\n3. Create a `query` for the Dynamics Account entity:\n\n```typescript\nconst accounts = query('account')\n\t\t\t\t\t.path('accounts') // Indicates Entity Name on Web API Url\n\t\t\t\t\t.where('name', QueryOperator.Contains, 'xrm')\n\t\t\t\t\t.orderBy('name')\n\t\t\t\t\t.select('name');\n```\n\n4. Call `dynamics` to obtain a connection to Dynamics:\n\n   \u003e `const dynamicsClient = dynamics(); //option to pass access token`\n\n5. Execute `accounts` query using `dynamicsClient`:\n\n```typescript\ndynamicsClient.fetch(accounts).then(results =\u003e { /* results is an array of accounts */ });\n```\n\n6. Update data in Dynamics by calling `save`:\n\n```typescript\nconst accountId = accounts[0].accountid; //account with name like '%xrm%'\ndynamicsClient.save('accounts', { name: 'more-xrm' }, accountId).then(id =\u003e { /* id of account */ });\n```\n\n## Example\n\nAn application will query the Account entity in Dynamics where the name contains _'xrm'_, then update the Account name to _'more-xrm'_\n\n\n```typescript\nimport dynamics from 'more-xrm/dist/Dynamics';\nimport query, { QueryOperator } from 'more-xrm/dist/Query';\n\n//Create a query\nconst accounts = query('account')\n                    .path('accounts') // Indicates Entity Name on Web API Url\n                    .where('name', QueryOperator.Contains, 'xrm')\n                    .orderBy('name')\n                    .select('name');\n\n//Connect to Dynamics\nconst dynamicsClient = dynamics();\n\n//Execute accounts query\ndynamicsClient.fetch(accounts).then(results =\u003e { \n\n    if(results.length \u003e 0) {\n        const accountId = accounts[0].accountid;\n\n        //Update data in Dynamics by calling save:\n        dynamicsClient.save('accounts', { name: 'more-xrm' }, accountId).then(id =\u003e {\n            \n            /* Account was updated */\n\n        });\n    }\n});\n\n```\n\n## License\n\n[MIT License](https://github.com/scalable-dynamics/more-xrm/blob/master/LICENSE)\n\n\u003csvg height=\"32\" viewBox=\"0 0 14 16\" version=\"1.1\" width=\"28\" aria-hidden=\"true\" style=\"float:left;margin-right:10px;\"\u003e\u003cpath fill-rule=\"evenodd\" d=\"M7 4c-.83 0-1.5-.67-1.5-1.5S6.17 1 7 1s1.5.67 1.5 1.5S7.83 4 7 4zm7 6c0 1.11-.89 2-2 2h-1c-1.11 0-2-.89-2-2l2-4h-1c-.55 0-1-.45-1-1H8v8c.42 0 1 .45 1 1h1c.42 0 1 .45 1 1H3c0-.55.58-1 1-1h1c0-.55.58-1 1-1h.03L6 5H5c0 .55-.45 1-1 1H3l2 4c0 1.11-.89 2-2 2H2c-1.11 0-2-.89-2-2l2-4H1V5h3c0-.55.45-1 1-1h4c.55 0 1 .45 1 1h3v1h-1l2 4zM2.5 7L1 10h3L2.5 7zM13 10l-1.5-3-1.5 3h3z\"\u003e\u003c/path\u003e\u003c/svg\u003e\n\n*more-xrm* is licensed under the\n[MIT](https://github.com/scalable-dynamics/more-xrm/blob/master/LICENSE) license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalable-dynamics%2Fmore-xrm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalable-dynamics%2Fmore-xrm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalable-dynamics%2Fmore-xrm/lists"}