Posts

Showing posts from June, 2022

GlideDate and Time

Image
 

Conditional Loops

Image
  if (condition) {} else {} ------------------------------------------------------------------ If needed to give another condition to the else, has to use ELSE IF: if(condition) {} else if(condition) {} ------------------------------------------------------------------------ if {} 1    if{} 2     else{} 2 else{} 1 --------------------------------------------------------------------------------------- IF , ESLE IF, ELSE:  ---------------------------------------------------------------- Switch: ---------------------------------------------------------------------------------------------------- Function Expression: Function Self Invoke: Accessing Objects 

Workflow Activities:

Turnstile :   The  Turnstile  activity limits how many times a workflow can pass through the same point. Change approval policy:     Used for the approval process. Rollback to:      Rollback To  is a workflow activity used for making the workflow run again from a certain point.

Cascade Variables

  Cascade Variables: Cascade Variables (once you click on tick the box) allow the functionality of using the same value in different catalog items by pulling from the initial form. Cascading allows values entered for variables in the initial order form to be passed to the equivalent variables in the ordered catalog items. For example, a variable on the initial order form prompts the customer to enter a delivery location value. If you enable cascading, the value for this variable then populates delivery location fields on each of the ordered items. It works like this- select the  Cascade variables  check box when creating the order guide. Then, create variables on the catalog items that match the names of the corresponding variables in the order guide. When a customer places an order, the variables on the ordered items inherit the values of the identically named variables in the order guide.

Call a servicenow workflow thorough business rule script

 var vars = {}; var w = new Workflow(); var context = w.startFlow(‘sys_id_of_the_workflow’, current, current.operation(), vars); Sys id of the workflow can be obtained by looking at the wf_workflow table

Error's in Coding

  Unterminated String Literal : Missed quotes  Variable is not declared: The variable is not declared in the CODE Undefined   If a variable is declared but not defined. Ex: var students;   var students = abc gs.info(students); EX: 'ga' is not defined, using noncommon variable names EX: ga.info(" Hello " ); Why are two 'while' loops that can't be executed within one GlideRecord query?  probably because when the 1st while loop ends the Gliderecord object refers to the last record for that query and thereafter it won't iterate over again as no records exist for this query

REST Integration

 REST - REpresentational State Transfer. It can accommodate - XML, JSON, HTM, Plain Text. Rest uses HTTP methods to interact with the remote system. These include  GET - To read a resource. POST - To create a resource. PATCH -  Update the specific value in the record.  (Can send only the data needed to be updated, no need for full data) PUT - Update an existing resource or create a new one if needed. (Need to send all info) DELETE - To remove a resource.  These deal with how data is passed to the REST API : Query parameters: Path parameters: Headers:  Request Body:  We have the inbound API's in the REST API Explorer. We can create the custom API's in the Scripted REST API.    Scripted REST API:  A Good plan  1. Purpose. 2. Inputs. (Path Parameters, Query Parameters, Request Body(Used input, post, and patch)) 3. Outputs. 4. Security for API. Requires Authentication, Requires snc_internal Role, ACL ( type = Endpoint). 5. Versioning: M...

Common Integration Questions

Image
  What is the difference between the put and POST? The difference between POST and PUT is that  PUT requests are idempotent . That is, calling the same PUT request multiple times will always produce the same result. In contrast, calling a POST request repeatedly have the side effects of creating the same resource multiple times.      2.  Difference between  PUT ,  POST ,  GET ,  DELETE  and  PATCH  in HTTP Verbs: The most commonly used HTTP verbs POST, GET, PUT, and DELETE are similar to  CRUD  (Create, Read, Update and Delete) operations in the database. We specify these HTTP verbs in the  capital  case. So, the below is the comparison between them. Create - POST Read - GET Update - PUT (Need to send all the values with updated fields, if we do not send all the data then the other field will be made empty). Delete - DELETE PATCH:  Submits a partial modification to a resource. If you only need to u...

Transform Maps

Image
Transform Script    OnStart : Runs once at the start of the Transform Process. Can have multiple onStart scripts and can run them based on the order. OnComplete: Runs when the entire transaction is completed. OnBefore: starts before the row transformation before the source row is transformed into the target row. OnAfter: runs after the source row has been transformed and saved. OnForeignInsert: Runs before a reference record is created. (If we have a Location as a Reference, then we can use this to add a new option). OnChoiceCreate : Runs before a new choice list entry is created. OnReject : This can be used when the OnForeignInsert and OnChoiceCreate both fail. This Skips the current row and processes the next record. This field is available if the target field is a choice list or reference field. This field specifies what to do if the import set contains a reference or choice value other than those available. Select one of these options: create : Create a new choice o...

How user name populates and not some other field value when we select user

Image
 If we select the user name from a reference field the user name gets populated because the Display  value is made true only for the Name. Note : We can have only one true value in a Table.

Easy way to understand the approval process of Change management - ServiceNow

Image
 There are three types of  Change requests based on ITIL. Normal Standard Emergency Normal - It is the only change request which goes through all the approvals and states of the Change process.  Standard - It is used for a less impactful implementation with a standard template and prior approval. Emergency - this is raised because of a Major Incident or a serious Outage that has to be rectified ASAP.  It bypasses the peer approval process( Asses stage).