Skip to content

Conversation

@Dhruvyadav2000
Copy link
Contributor

PR Description:

Overview

Enhances user experience by automatically filling location fields in catalog items based on the logged-in user's profile data.

What's Changed

Added

  • Script Include: LocationUtilsAjax (Client Callable)

    • Retrieves user's location details from sys_user and cmn_location tables
    • Returns location, city, state, and country as JSON
  • Catalog Client Script: Auto-populate Location Variables (onLoad)

    • Executes on form load
    • Populates catalog variables: location, city, state, country

Benefits

  • Eliminates manual data entry for users
  • Ensures consistency in location data
  • Improves form completion speed

Testing Checklist

  • Script Include is client callable
  • Variables populate on form load
  • No console errors in browser

Dependencies

  • User must have location set in profile (sys_user.location)
  • Location records must have name, city, country, state fields populated

Pull Request Checklist

Overview

  • Put an x inside of the square brackets to check each item.
  • I have read and understood the CONTRIBUTING.md guidelines
  • My pull request has a descriptive title that accurately reflects the changes and the description has been filled in above.
  • I've included only files relevant to the changes described in the PR title and description
  • I've created a new branch in my forked repository for this contribution

Code Quality

  • My code is relevant to ServiceNow developers
  • My code snippets expand meaningfully on official ServiceNow documentation (if applicable)
  • I've disclosed use of ES2021 features (if applicable)
  • I've tested my code snippets in a ServiceNow environment (where possible)

Repository Structure Compliance

  • I've placed my code snippet(s) in one of the required top-level categories:
    • Core ServiceNow APIs/
    • Server-Side Components/
    • Client-Side Components/
    • Modern Development/
    • Integration/
    • Specialized Areas/
  • I've used appropriate sub-categories within the top-level categories
  • Each code snippet has its own folder with a descriptive name

Documentation

  • I've included a README.md file for each code snippet
  • The README.md includes:
    • Description of the code snippet functionality
    • Usage instructions or examples
    • Any prerequisites or dependencies
    • (Optional) Screenshots or diagrams if helpful

Restrictions

  • My PR does not include XML exports of ServiceNow records
  • My PR does not contain sensitive information (passwords, API keys, tokens)
  • My PR does not include changes that fall outside the described scope

This README provides detailed instructions on how to auto-populate location variables in ServiceNow Catalog items based on the logged-in user's profile information, including prerequisites, components, installation steps, testing, configuration notes, and security considerations.
@rohi-v rohi-v self-assigned this Oct 25, 2025
@rohi-v
Copy link
Contributor

rohi-v commented Oct 25, 2025

Hi @Dhruvyadav2000

Thankyou for your submission.

we appreciate the effort you’ve put into this contribution. We’ve labeled it as hacktoberfest-accepted so it still counts toward your Hacktoberfest progress.

For Hacktoberfest, we’re aiming for high-quality contributions providing real-world use developer cases.

Just a quick note: this repo already has similar examples, so it might be worth checking for duplicates or similar codes before submitting.
Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.

@rohi-v rohi-v closed this Oct 25, 2025
@rohi-v rohi-v added the hacktoberfest-accepted The PR is accepted for Hacktoberfest, regardless of being merged or not label Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted The PR is accepted for Hacktoberfest, regardless of being merged or not

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants