Skip to content

Conversation

prynacshrma
Copy link
Contributor

Summary
This pull request introduces the fetchJSONObject function, which retrieves a JSON object containing field values from a specified GlideRecord instance in ServiceNow. The function allows for optional input of field names; if none are provided, it defaults to fetching all fields.

Key Features

  • Validates the GlideRecord instance to ensure it is properly initialized.
  • Supports the retrieval of specified fields, or all fields if no arguments are given.

Benefits
This function enhances data handling by providing a straightforward way to extract and format GlideRecord data as a JSON object, making it easier to work with in various ServiceNow applications.

The script fetches a JSON object containing specified field values from a GlideRecord instance in ServiceNow.
@am-shakeel am-shakeel self-assigned this Oct 27, 2024
Copy link

@am-shakeel am-shakeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@am-shakeel am-shakeel merged commit 26a2502 into ServiceNowDevProgram:main Oct 27, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants