Skip to content

Commit 9883d95

Browse files
authored
merge PRs
1 parent a028d6b commit 9883d95

File tree

1 file changed

+92
-149
lines changed

1 file changed

+92
-149
lines changed

README.md

Lines changed: 92 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,202 +1,145 @@
1-
# 🚀 ServiceNow Code Snippets
2-
3-
<div align="center">
4-
51
![Code Snippets Banner](https://github.com/ServiceNowDevProgram/code-snippets/assets/31702109/f9fa072a-4c0c-426b-8eed-200c6616ff60)
62

7-
**A community-driven collection of ServiceNow code snippets and solutions**
3+
<div align="center">
84

95
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat-square)](CONTRIBUTING.md)
106
[![Hacktoberfest](https://img.shields.io/badge/Hacktoberfest-Participating-orange?style=flat-square)](https://github.com/ServiceNowDevProgram/Hacktoberfest)
117

12-
[Explore Snippets](#-repository-structure) · [Contribute](#-how-to-contribute) · [Join Community](https://sndevs.com)
13-
148
</div>
159

16-
---
17-
18-
## 📖 About
19-
20-
Welcome to the **ServiceNow Code Snippets** repository - your go-to resource for practical, real-world ServiceNow code examples. Managed by the ServiceNow Developer Program and the vibrant **sndevs** Slack community, this repository features battle-tested code snippets submitted by developers like you.
21-
22-
> 🎃 **Hacktoberfest Participant**: Check out our [main Hacktoberfest repository](https://github.com/ServiceNowDevProgram/Hacktoberfest) and [official blog post](https://devlink.sn/hacktoberfest) for more projects!
23-
24-
### ✨ What Makes This Repository Special
25-
26-
- 🌍 **Community-Powered**: Real solutions from real developers
27-
- 📚 **Comprehensive**: Covers all aspects of ServiceNow development
28-
- 🔄 **Always Growing**: Regular updates and new snippets
29-
- 🎯 **Practical**: Code you can actually use in production
30-
- 🤝 **Collaborative**: Built by developers, for developers
31-
32-
---
33-
34-
## 🗂️ Repository Structure
35-
36-
<table>
37-
<tr>
38-
<td width="50%">
10+
# ServiceNow Code Snippets Repository
3911

40-
### 📚 [Core ServiceNow APIs](Core%20ServiceNow%20APIs/)
41-
Essential JavaScript APIs and classes
42-
- GlideRecord & GlideAjax
43-
- GlideSystem & GlideUser
44-
- GlideDate & GlideDateTime
45-
- Core utility functions
12+
Welcome to ServiceNow's Code Snippets community repository, managed by the Developer Program and the sndevs Slack community.
4613

47-
### ⚙️ [Server-Side Components](Server-Side%20Components/)
48-
Server-executed code patterns
49-
- Background Scripts
50-
- Business Rules & ACLs
51-
- Script Includes
52-
- Scheduled Jobs & Transform Maps
14+
Inside this repository, you will find community submitted code-snippets and their variants for different use-cases.
5315

54-
### 🖥️ [Client-Side Components](Client-Side%20Components/)
55-
Browser-based functionality
56-
- Client Scripts & UI Policies
57-
- Catalog Client Scripts
58-
- UI Actions & UI Scripts
59-
- UX Framework components
16+
**[📝 Contribution Guidelines](CONTRIBUTING.md)** | **[📚 Browse Categories](#repository-organization)** | **[🔍 How to Use](#how-to-use-this-repository)**
6017

61-
</td>
62-
<td width="50%">
18+
> Interested in our other ServiceNow Hacktoberfest projects? See the main repository [here](https://github.com/ServiceNowDevProgram/Hacktoberfest) or see our official blog post [here](https://devlink.sn/hacktoberfest).
6319
64-
### 🚀 [Modern Development](Modern%20Development/)
65-
Contemporary ServiceNow approaches
66-
- Service Portal widgets
67-
- NOW Experience Framework
68-
- GraphQL implementations
69-
- ECMAScript 2021+ features
20+
**Note:** ServiceNowDevProgram has many repositories that can be imported directly into ServiceNow, this is not one of them; This repository is meant to be edited directly in GitHub or any other Git-enabled IDE like VS Code.
7021

71-
### 🔗 [Integration](Integration/)
72-
External system connectivity
73-
- REST & SOAP integrations
74-
- Mail Scripts & Webhooks
75-
- MIDServer utilities
76-
- Attachment handling
22+
## Disclaimer
7723

78-
### 🎯 [Specialized Areas](Specialized%20Areas/)
79-
Domain-specific solutions
80-
- CMDB & Discovery
81-
- ITOM & Performance Analytics
82-
- ATF Steps & Test utilities
83-
- Agile Development tools
24+
Please note the following:
8425

85-
</td>
86-
</tr>
87-
</table>
26+
1. **Community-Sourced Code**: The code found in this repository is contributed by members of the community and has not been vetted or officially endorsed by the repository owners.
8827

89-
---
28+
2. **Use at Your Own Risk**: Users are advised to exercise caution and thoroughly review the code before implementing it in their ServiceNow instances. We strongly recommend a comprehensive review to ensure the code aligns with your specific requirements and security standards.
9029

91-
## 🚀 How to Contribute
30+
3. **Reporting Mistakes and Issues**: If you come across any mistakes, issues, or improvements in the code, we encourage you to report them and consider contributing to the repository by submitting corrections or enhancements.
9231

93-
We'd love your contributions! Here's how to get started:
32+
4. **No Warranty or Support**: This repository is provided as-is, without any warranties or guarantees. It does not come with official support from the ServiceNow team or the repository owners.
9433

95-
### Quick Start
34+
By using the code from this repository, you acknowledge that you have read and understood this disclaimer. Your use of the code is at your own discretion and risk.
9635

97-
1. **Fork** this repository (you get a point just for forking! 🎉)
98-
2. **Create** a new branch (`git checkout -b feature/amazing-snippet`)
99-
3. **Add** your code snippet following our [structure guidelines](CONTRIBUTING.md)
100-
4. **Commit** your changes (`git commit -m 'Add amazing snippet for X'`)
101-
5. **Push** to your branch (`git push origin feature/amazing-snippet`)
102-
6. **Open** a Pull Request
36+
We appreciate your participation and contributions to this community-driven project. Let's collaborate to make it a valuable resource for ServiceNow developers and enthusiasts.
10337

104-
## 🌐 Contribute from the Web (No Setup Needed!)
38+
🔔🔔🔔<br>
39+
**_CONTRIBUTORS must follow all guidelines in [CONTRIBUTING.md](CONTRIBUTING.md)_** or run the risk of having your Pull Requests labeled as spam.<br>
40+
🔔🔔🔔
10541

106-
You can contribute directly from your browser — no cloning required!
42+
## Table of Contents
10743

108-
1. Click **Fork** at the top-right corner of this page
109-
2. Open the folder where you want to add or edit a file
110-
3. Click **Add file → Create new file** (or edit an existing one)
111-
4. Scroll down, add a **commit message**, and select
112-
> "**Create a new branch for this commit and start a pull request**"
113-
5. Click **Propose changes → Create pull request**
44+
- [How to Use This Repository](#how-to-use-this-repository)
45+
- [Repository Organization](#repository-organization)
46+
- [Finding Snippets](#finding-snippets)
47+
- [Folder Structure](#folder-structure)
48+
- [Contributing](#we-invite-you-to-contribute)
49+
- [Disclaimer](#disclaimer)
11450

115-
🎉 That’s it — your contribution will be reviewed soon!
51+
## How to Use This Repository
11652

117-
### 📝 Contribution Guidelines
53+
This repository contains code snippets that you can use in your ServiceNow instance. Here's how to make the most of it:
11854

119-
> 🔔 **IMPORTANT**: All contributors **must** follow the guidelines in [CONTRIBUTING.md](CONTRIBUTING.md) or risk having PRs labeled as spam.
55+
1. **Browse by Category**: Navigate through the [six major categories](#repository-organization) to find snippets relevant to your needs.
56+
2. **Copy and Adapt**: Once you find a useful snippet, copy the code and adapt it to your specific use case in your ServiceNow instance.
57+
3. **Read the Documentation**: Each snippet folder contains a README.md file that explains how the snippet works and how to implement it.
58+
4. **Search by Topic**: Use GitHub's search functionality to find snippets by keywords (e.g., "GlideRecord", "REST", "UI Action").
59+
5. **Contribute Your Own**: If you have a useful snippet, consider [contributing](#we-invite-you-to-contribute) to help others.
12060

121-
**Key Points:**
122-
- Follow the existing folder structure
123-
- Include clear documentation and comments
124-
- Provide real-world use cases
125-
- Test your code before submitting
126-
- Use descriptive commit messages
61+
## Repository Organization
12762

128-
**Not sure where to start?** Check out issues labeled `good-first-issue` or `help-wanted`!
63+
The repository is organized into **6 major categories** that cover all aspects of ServiceNow development:
12964

130-
---
131-
132-
## ⚠️ Important Disclaimer
133-
134-
<details>
135-
<summary>Click to read full disclaimer</summary>
136-
137-
### Community-Sourced Content
138-
139-
**Please note the following:**
140-
141-
1. **Not Officially Endorsed**: Code in this repository is community-contributed and not officially vetted or endorsed by ServiceNow or repository owners.
142-
143-
2. **Use at Your Own Risk**: Always review code thoroughly before implementing in your ServiceNow instances. Test in sub-production environments first.
144-
145-
3. **Report Issues**: Found a bug or improvement? Please [open an issue](../../issues) or submit a correction.
146-
147-
4. **No Warranty**: This repository is provided "as-is" without warranties or guarantees. No official support is provided.
65+
### 📚 [Core ServiceNow APIs](Core%20ServiceNow%20APIs/)
66+
Essential ServiceNow JavaScript APIs and classes including GlideRecord, GlideAjax, GlideSystem, GlideDate, GlideDateTime, and other foundational APIs.
14867

149-
5. **Security First**: Always validate code against your organization's security standards before deployment.
68+
### ⚙️ [Server-Side Components](Server-Side%20Components/)
69+
Server-side code including Background Scripts, Business Rules, Script Includes, Scheduled Jobs, Transform Map Scripts, and other server-executed components.
15070

151-
**By using code from this repository, you acknowledge you've read and understood this disclaimer.**
71+
### 🖥️ [Client-Side Components](Client-Side%20Components/)
72+
Client-side code including Client Scripts, Catalog Client Scripts, UI Actions, UI Scripts, UI Pages, and UX framework components.
15273

153-
</details>
74+
### 🚀 [Modern Development](Modern%20Development/)
75+
Modern ServiceNow development approaches including Service Portal, NOW Experience Framework, GraphQL implementations, and ECMAScript 2021 features.
15476

155-
---
77+
### 🔗 [Integration](Integration/)
78+
External system integrations, data import/export utilities, RESTMessageV2 examples, Mail Scripts, MIDServer utilities, and attachment handling.
15679

157-
## 🏆 Recognition
80+
### 🎯 [Specialized Areas](Specialized%20Areas/)
81+
Domain-specific functionality including CMDB utilities, ITOM scripts, Performance Analytics, ATF Steps, Agile Development tools, and other specialized use cases.
15882

159-
View our contributor leaderboard and stats in the [Hacktoberfest repository](https://github.com/ServiceNowDevProgram/Hacktoberfest#leaders)!
83+
## Finding Snippets
16084

161-
---
85+
There are several ways to find the snippets you need:
16286

163-
## 🌐 Community & Resources
87+
1. **By Category**: Browse the six major categories listed above.
88+
2. **By Search**: Use GitHub's search functionality with keywords like:
89+
- API names: `GlideRecord`, `GlideSystem`, `GlideAjax`
90+
- Component types: `Business Rule`, `Client Script`, `UI Action`
91+
- Functionality: `REST`, `SOAP`, `Import`, `Export`
92+
- Use cases: `Authentication`, `Notification`, `Workflow`
16493

165-
<div align="center">
94+
3. **By Tags**: Many snippets include common keywords in their README files that can be searched.
16695

167-
| Resource | Description |
168-
|----------|-------------|
169-
| [sndevs Slack](https://sndevs.com) | Join thousands of ServiceNow developers |
170-
| [Developer Portal](https://developer.servicenow.com) | Official ServiceNow documentation |
171-
| [Community Forum](https://www.servicenow.com/community/) | Ask questions and share knowledge |
172-
| [Developer Blog](https://developer.servicenow.com/blog.do) | Latest news and tutorials |
96+
## Folder Structure
17397

174-
</div>
98+
The repository follows a consistent structure to make navigation easier:
17599

176-
---
100+
```
101+
Top-Level Category/
102+
├── Sub-Category/
103+
│ ├── Specific Snippet/
104+
│ │ ├── README.md # Description and usage instructions
105+
│ │ ├── snippet_file.js # The actual code snippet
106+
│ │ └── variant.js # Variations of the snippet (if applicable)
107+
```
177108

178-
## 📄 License
109+
For example:
110+
```
111+
Core ServiceNow APIs/
112+
├── GlideRecord/
113+
│ ├── Query Performance Optimization/
114+
│ │ ├── README.md
115+
│ │ ├── basic_query.js
116+
│ │ └── optimized_query.js
117+
```
179118

180-
This repository is available under the MIT License. See [LICENSE](LICENSE) for more details.
119+
## We invite you to contribute!
181120

182-
---
121+
We welcome contributions from the ServiceNow developer community! Your knowledge and experience can help others solve common challenges.
183122

184-
## 🙏 Acknowledgments
123+
## 🌐 Contribute from the Web (No Setup Needed!)
185124

186-
Special thanks to:
187-
- All our amazing [contributors](../../graphs/contributors)
188-
- The ServiceNow Developer Program team
189-
- The sndevs community moderators
190-
- Everyone who has starred, forked, or shared this project
125+
This repository has been approved by Hacktoberfest in spirit of learning source control and getting started in your open-source journey. You can contribute directly from your browser without needing a ServiceNow instance:
191126

192-
---
127+
1. Click **Fork** at the top-right corner of this page
128+
2. Open the folder where you want to add or edit a file
129+
3. Click **Add file → Create new file** (or edit an existing one)
130+
4. Scroll down, add a **commit message**, and select
131+
> "**Create a new branch for this commit and start a pull request**"
132+
5. Click **Propose changes → Create pull request**
193133

194-
<div align="center">
134+
That's it! **For detailed contribution instructions, please read our [CONTRIBUTING.md](CONTRIBUTING.md) guide before submitting.**
195135

196-
**⭐ Star this repo if you find it helpful!**
136+
### What makes a good contribution?
197137

198-
Made with ❤️ by the ServiceNow Developer Community
138+
- **Useful snippets** that solve common ServiceNow development challenges
139+
- **Well-documented code** with clear comments explaining how it works
140+
- **Proper organization** following the repository structure
141+
- **Variations** of snippets for different use cases when applicable
199142

200-
[Report Bug](../../issues) · [Request Feature](../../issues) · [View Statistics](../../pulse)
143+
## Leaderboard
201144

202-
</div>
145+
Looking for the old leaderboard? We've moved the leaderboard to the overarching [Hacktoberfest](https://github.com/ServiceNowDevProgram/Hacktoberfest#leaders) repository and have expanded its scope to all participating projects.

0 commit comments

Comments
 (0)