How to fetch the variable value in service now when ordering item from service catalog? - servicenow

I have successfully ordered an item from service catalog using REST API. While ordering I sent a JSON data in the request body containing certain key value pairs which are meant to be stored in variable of the catalog item. After the successful order, the response generated contains the sys_id, request_number, request_id, table name. Now, when I want to fetch the values passed to variables, the only way available is to make a GET call using the REST API for Tables. So, I am fetching the record using the generated sys_id and table name which is generated as response of order API. The table name is sc_request.
But that is not providing the variable value information in the response body of the GET call.

You should be able to get the values of variables using the Table API. If you go to the REST API explorer in ServiceNow, notice the field "sysparm_fields". put the name of your variabe(s) in there like this "variables.var_name". This will retrieve their values and display values in the response.

Related

Get RITM number attached to Change request in Service Now

I am trying to get the Request number (RITM) that is attached in the Change Request (CR) in service now. I am able to get the Request number but not able to get for which Change Request the corresponding Request number is attached. I have used the table "sc_req_items" to get the Request number and "Change_request" table to get the Change request number.
Service now screenshot
I need the ritm number corresponding to the Change Request (CR) in the screenshot. how to get this?
There is a Out Of The Box/Baseline Related list available on the Change Request table. The query that this Related List is using is the Parent field:
parent=<sys_id/GUID for the change record>^.
If Parent (reference field) is not the link between your objects then you need to map what the link is, is it another field or an m2m table.

Creating ResponseEntity CREATED for multiple records

I have an application that exposed an endpoint to insert multiple records into the DB. It takes in a list of ids and inserts them into the DB.
Now I have already worked on an endpoint, where I was getting a DTO and then I inserted that DTO into the DB which gave back the UID of the record. Using this UID I created the URI that I used to create and return the ResponseEntity.created() like below:
return ResponseEntity.created(URI.create(location)).body(roId);
The challenge here is that it works for only one location and one UID. Is it possible to do that same in case I am inserting multiple records in the DB and I will be getting a list of ids? Is this even the right approach?
NOTE: I do not want to return the List<ResponseEntity<Long>>. I require ResponseEntity<List<Long>>.

HTTP Get to compare to Dataverse fields

HTTP Get to compare to Dataverse fields
an hour ago
I'm having trouble with my flow. I'm not sure whether to have this flow as scheduled or not at the moment. There's an external database that contains a field for a name that I need. This is collected by another piece of software. In my Dataverse table I don't have the name, but I need it.
So I'm trying to get it by using an HTTP Get request. I'm trying to compare the CustomerID from each row in the HTTP request to the CustomerID in the Dataverse table (these match up). If the CustomerIDs match up, the name is put into the Dataverse table using Update a row.
Here is what I have so far
-Dataverse list rows
-HTTP Get
-Parse JSON HTTP body
-Apply to each CustomerID from Parse JSON
-Apply to each value from list rows
-Condition - if JSON CustomerID = Dataverse CustomerID
-Update row. RowID = CurrentItem
Nothing seems to work. I've had a variety of errors.
Is there a better method to achieve this?
Thank you

Using PowerAutomate, how do you check for unique values between davaverse table and http request?

What I am trying to do:
Check http response against my current table in davaverse to only add unique values to current table. In JavaScript you'd just use a new Set but I am new to power apps and don't know how to get same results.
Example of flow I am trying to do:
Http request
↓
Parse Json
↓
Compare data from request with current table items
Example:
For each row
If response contact name != contact name in table
&&
If response ID != ID in table
&&
If response type != type in table
Then add response data to table
Problems:
Currently, I do not know how to add the dataverse table to check row data vs request data. I see an action for "relate rows" but seems like I'd have to create a table with response data to use it.. which should be an extra step.
If using a function, I would believe I would have to use an expression with contains(). If this is the route; How do I add my table as the collection part of contains expression?

Rest API Call in uipath

My requirement is to fetch the data from rest api data and store it in separate variable. I had the endpoint url(https://abcdev.service-now.com/api/now/table/sc_multi_row_question_answer?sysparm_query=parent_id%3Dxxxxxxxxxxxxxxxxxxxx&sysparm_display_value=true&sysparm_exclude_reference_link=true&sysparm_fields=variable_set%2Cvalue%2Citem_option_new%2Crow_index).This is fetching the datas for all 3 rows. But i wants that this user needs to be added in this delegate access like that.
I have attached the image for which field i want to fetch.
I wants to fetch user to be added,level of access required,inbox,calender,tasks,contacts,notes,journal,select required send rights for these field i wants to fetch row by row.kindly assist me in that.
You will receive the response in JSON with all the rows, but you can use de serialize JSON Array activity to de serialize the JSON in each record with all the columns you have mentioned.
And Once you have the rows in the array JSON you can loop through it and get the details for each field.

Resources