<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Submit a Catalog Item via Service Catalog API with Variables. in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677141#M334067</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to find some information on how to create an item from my catalog via rest API. I have many items that have Variables in them that need to be filled out to capture data before submission. I have need to create items via REST. I understand that the Service Catalog API can be used to do this, but I need to set my custom created variables as well.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;I have an Item called "Request Something Else". This item has three variables on the form. Those are Description and User. I need to populate these two variables with plain text. How would one go about setting up this request in the REST API Explorer for example using the Service Catalog API?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jun 2018 15:39:16 GMT</pubDate>
    <dc:creator>JefferyDean</dc:creator>
    <dc:date>2018-06-11T15:39:16Z</dc:date>
    <item>
      <title>Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677141#M334067</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to find some information on how to create an item from my catalog via rest API. I have many items that have Variables in them that need to be filled out to capture data before submission. I have need to create items via REST. I understand that the Service Catalog API can be used to do this, but I need to set my custom created variables as well.&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;I have an Item called "Request Something Else". This item has three variables on the form. Those are Description and User. I need to populate these two variables with plain text. How would one go about setting up this request in the REST API Explorer for example using the Service Catalog API?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:39:16 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677141#M334067</guid>
      <dc:creator>JefferyDean</dc:creator>
      <dc:date>2018-06-11T15:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677142#M334068</link>
      <description>&lt;P&gt;If you take a look at the Service Catalog API scripted rest api in your instance, then click into the&amp;nbsp;Add Item To Cart&amp;nbsp;scripted rest resource and click the documentation tab it gives you a&amp;nbsp;request body example that you should be able to use to add an item to the cart with the variables populated:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;{  
   'sysparm_quantity': 2,
   'variables': {  
      'carrier': 'at_and_t_mobility',
      'data_plan': '500MB',
      'duration': 'eighteen_months',
      'color': 'black',
      'storage': 'sixtyfour'
   }
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The documentation for that endpoint can be found &lt;A href="https://docs.servicenow.com/bundle/kingston-application-development/page/integrate/inbound-rest/concept/c_ServiceCatalogAPI.html#ariaid-title17" rel="nofollow"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 17:57:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677142#M334068</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2018-06-11T17:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677143#M334069</link>
      <description>&lt;P&gt;Hello Brad,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This came handy. I got another issue.&amp;nbsp;we are using a bot to call the&amp;nbsp;catalog.&amp;nbsp;Be default the&amp;nbsp;Requested For/Caller is being set as the user logged in&amp;nbsp;for the bot service (Eg. admin). How do i change this? I am capturing the user details using the bot. Setting the variables is not working.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jun 2018 17:11:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677143#M334069</guid>
      <dc:creator>Santhana Rajhan</dc:creator>
      <dc:date>2018-06-19T17:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677144#M334070</link>
      <description>&lt;P&gt;Hi Brad,&lt;/P&gt;
&lt;P&gt;How can I set the fields (requested_for, opened_by) value of sc_request/sc_req_item using the service catalog rest API?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;Ravi Gupta&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 18:21:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677144#M334070</guid>
      <dc:creator>ravigupta</dc:creator>
      <dc:date>2018-12-04T18:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677145#M334071</link>
      <description>&lt;P&gt;I think requested for would be on the cart (you might need to look at the scripted rest api for that) and then opened by will default to the user account making the rest call.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 22:01:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677145#M334071</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2018-12-04T22:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677146#M334072</link>
      <description>&lt;P&gt;Hey Brad,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would you set values for Variable Sets? It seems like we're able to set values for variables, but not variable sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Albert&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 03:25:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677146#M334072</guid>
      <dc:creator>Albert Chan</dc:creator>
      <dc:date>2019-08-22T03:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677147#M334073</link>
      <description>&lt;P&gt;I believe you would treat the variables on the item and on the item through variable sets the same way.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 12:35:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677147#M334073</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2019-08-22T12:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677148#M334074</link>
      <description>&lt;P&gt;Hi Brad,&lt;/P&gt;
&lt;P&gt;Thanks for the response. I'm trying to use the REST API Explorer with the "add_to_cart" API. I created a simple string variable and the variable and value does not come back in the response body. For this API, the documentation says, "variables Name/value pairs of all mandatory cart item variables. Mandatory variables are defined on the associated form." If I make this variable mandatory at the variable level, then I get a 400 response.&lt;/P&gt;
&lt;P&gt;What I'm doing wrong?&lt;/P&gt;
&lt;P&gt;Albert&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2019 15:22:09 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677148#M334074</guid>
      <dc:creator>Albert Chan</dc:creator>
      <dc:date>2019-08-22T15:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677149#M334075</link>
      <description>&lt;P&gt;Can you show an example for set values for variable set in json&lt;/P&gt;
&lt;P&gt;variable set name - 'process_detail':&lt;BR /&gt;value: "[{"prone_to_human_error":"Yes","percent_standardized":"25","access_unstructured_data":"Yes","percent_rule_based":"30%","process_change_frequency":"N/A"}]"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;'sysparm_quantity':2,&lt;/P&gt;
&lt;P&gt;'variables':{&lt;BR /&gt;'process_name':'test claysys process',&lt;BR /&gt;'process_steps': 'test1',&lt;BR /&gt;'notes':'testnote',&lt;BR /&gt;'process_name':'processtest' &lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;The above is my json.Could you help me embed the variable set in it..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;pls help...&lt;/P&gt;
&lt;P&gt;Thanks in advance..&lt;/P&gt;</description>
      <pubDate>Fri, 20 Nov 2020 05:06:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677149#M334075</guid>
      <dc:creator>jes3</dc:creator>
      <dc:date>2020-11-20T05:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Submit a Catalog Item via Service Catalog API with Variables.</title>
      <link>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677150#M334076</link>
      <description>&lt;P&gt;Hi Brad,&lt;/P&gt;
&lt;P&gt;Could you please tell me how I can pass an array of values to a variable?&lt;/P&gt;
&lt;P&gt;For eg:&lt;/P&gt;
&lt;P&gt;{ &lt;BR /&gt; 'sysparm_quantity': 1,&lt;BR /&gt; 'variables': { &lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;'value1': ["k1":"v1", "k2":"v2"]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;'value2': 'some value'&lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jan 2021 04:35:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/submit-a-catalog-item-via-service-catalog-api-with-variables/m-p/1677150#M334076</guid>
      <dc:creator>Supriya32</dc:creator>
      <dc:date>2021-01-05T04:35:14Z</dc:date>
    </item>
  </channel>
</rss>

