i am not able to post Requested for field using the API explorer to the sctask table

chercm
Mega Sage

i am using buy item ( post) , using catalog task API . it is getting a blank field on it . when the req is created 

 

 

{

 

  "sysparm_quantity" :"1",

   "variables":{

      "requested_for" : "",

        "type_of_room_sqeep_00" : "",

        "time_of_room_sweep" : "",

        "building" : ",

       "select_location_00" : ",

      "business_justification" : ""

   }

}

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@chercm 

you should be using Cart API in REST Explorer to submit a request and it will create REQ, RITM

Why to use Catalog Task API?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar or to use this ?

 

var cart = new sn_sc.CartJS();
var item = { // Note that values using CartJS are instantiated via a JSON object
	'sysparm_id': '060f3afa3731300054b6a3549dbe5d3e',
	'sysparm_quantity': '1',
	'variables': {
		'ram': '16',
		'os': 'win10',
		'storage': '1tb'
	}
};
var cartVals = cart.addToCart(item); // The addToCart function returns a JSON object reflecting the status of the cart
var checkoutVals = cart.checkoutCart(); // The checkoutCart function returns a JSON object with info about the submitted cart, contents varying if two-step checkout is active

@chercm 

what's your business requirement?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar what i was trying to do is to use Microsoft power automate http function and servicenow rest aPI explorer to post a rest API call to a certain form to create ritm, req and sctask 

 

variable : 

"requested_for" : "",

        "type_of_room_sqeep_00" : "",

        "time_of_room_sweep" : "",

        "building" : ",

       "select_location_00" : ",

      "business_justification" : ""