<?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 Re: How to pass dynamic values to single run script based on if condition in ServiceNow AI Platform forum</title>
    <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821063#M194097</link>
    <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; in this cases, instead of while/switch, create a run script and check all the variable value and store it in different scratchpad variables/activity result and in next run script you can check these&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (current.variables.var_name == 'value1') {&lt;BR /&gt;activity.result = 'value1';&lt;BR /&gt;} else if (current.variables.var_name == 'value2') {&lt;BR /&gt;activity.result = 'value2';&lt;BR /&gt;}&lt;BR /&gt;else if (current.variables.var_name == 'value2' &amp;amp;&amp;amp; current.variables.var_name == 'value1') {&lt;BR /&gt;activity.result = 'value3';&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Feb 2024 02:10:42 GMT</pubDate>
    <dc:creator>Harish KM</dc:creator>
    <dc:date>2024-02-09T02:10:42Z</dc:date>
    <item>
      <title>How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2819821#M194061</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having multiple if conditions such as if Keyboard needed is selected as Yes, then in the run script , I want to consume a keyboard record and assign to requester.&lt;/P&gt;&lt;P&gt;If mouse needed is selected as Yes,&amp;nbsp;then in the run script , I want to consume a mouse record and assign to requester.&lt;/P&gt;&lt;P&gt;If Webcam needed is selected as Yes,&amp;nbsp;then in the run script , I want to consume a webcam record and assign to requester.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, for the keyboard, the item name is Ergo Keyboard 123, for the mouse, the item name is Mouse CPA1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I am thinking to use a single run script but pass these values from if condition to run script. How it is possible.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;var consUtil = new Consumables();&lt;/DIV&gt;&lt;DIV&gt;var gr = new GlideRecord('alm_consumable');&lt;/DIV&gt;&lt;DIV&gt;gr.addQuery('stockroom', 'Tech distribution center'); //Tech distribution center&lt;/DIV&gt;&lt;DIV&gt;gr.addQuery('display_name', 'Ergo Keyboard 123');&lt;/DIV&gt;&lt;DIV&gt;gr.addQuery('install_status', '6'); //in stock&amp;nbsp; - state&lt;/DIV&gt;&lt;DIV&gt;gr.addQuery('substatus', 'available');&lt;/DIV&gt;&lt;DIV&gt;gr.query();&lt;/DIV&gt;&lt;DIV&gt;if (gr.next()) {&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; gs.log("stock is available " + gr.quantity);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; workflow.scratchpad.consumable = consUtil.splitForeground('02f2114547083d94785b87d8536d43fc', 1, '10', '', '', '', '', current.request.requested_for);&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;else&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;task.state='2'; //work in progress&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;task.work_notes ='This task was closed without&amp;nbsp; an item '&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is for keyboard , how can I pass dynamically for all items. Please guide&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 08 Feb 2024 09:15:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2819821#M194061</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-08T09:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2819868#M194064</link>
      <description>&lt;P&gt;Hello &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; ,&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;// Add your condition to check&lt;BR /&gt;if (condition) {&lt;BR /&gt;// Dynamic value when condition is true&lt;BR /&gt;var dynamicValue = "Dynamic Value 1";&lt;BR /&gt;} else {&lt;BR /&gt;// Dynamic value when condition is false&lt;BR /&gt;var dynamicValue = "Dynamic Value 2";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Use the dynamicValue in your script&lt;BR /&gt;gs.info("Dynamic Value: " + dynamicValue);&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Replace 'condition', "Dynamic Value 1", and "Dynamic Value 2" with your actual conditions and dynamic values.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this will helps to resolve your issue then please mark helpful and accept as solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks &amp;amp; Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Sayali Gurav&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 09:44:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2819868#M194064</guid>
      <dc:creator>Sayali Gurav</dc:creator>
      <dc:date>2024-02-08T09:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820531#M194080</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/503568"&gt;@Sayali Gurav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to put multiple if conditions in the workflow and all should point to same run script&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please let me know where we can give the condition and pass the dynamic values?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 15:29:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820531#M194080</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-08T15:29:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820559#M194081</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt;&amp;nbsp;in that case go for switch statement where you can have multiple dynamic values to pass to your run script.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 15:46:32 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820559#M194081</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-08T15:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820573#M194082</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;In this case, switch shows the choices for that variable.&lt;/P&gt;&lt;P&gt;But in my case. If keyboard is selected as '&lt;SPAN&gt;Ergo Keyboard 123&lt;/SPAN&gt;', then run script should execute.&lt;/P&gt;&lt;P&gt;If mouse is selected as '&lt;SPAN&gt;Mouse CPA1&lt;/SPAN&gt;',&amp;nbsp;then run script should execute. As a sample below. I want to execute all if statements. How can it be acheived. Single run script but dynamic value should be passed each time.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Renu9_0-1707407756805.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328468iDA31D9C7D32FB1C3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Renu9_0-1707407756805.png" alt="Renu9_0-1707407756805.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Feb 2024 15:56:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2820573#M194082</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-08T15:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821040#M194093</link>
      <description>&lt;P&gt;HI &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; switch statement will execute based on the choice selected, if you still want to use if, you can use. In your screen shot the 1st if statement, if keyboard is not selected then the "no" option should point to the next if statement. which you have left blank so in this case the if is not moving to next statement.&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;1st statment:&lt;/P&gt;&lt;P&gt;keyboard selected ? Yes --&amp;gt; run script&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; No --&amp;gt; point to next if statement&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 00:58:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821040#M194093</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-09T00:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821050#M194094</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this case i have to run all the if statements . Because the user can request for keyboard mouse webcam etc etc. so if i keep if else condition then if keyboard satisfied it is not going to mouse or webcam part. So if else wont work&lt;/P&gt;&lt;P&gt;in switch case can u help me with that. Because if i use switch block it is displaying the choices in that variable .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 01:23:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821050#M194094</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-09T01:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821051#M194095</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; switch also will execute either one. May I know your use case ? what needs to be done?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 01:26:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821051#M194095</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-09T01:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821053#M194096</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my use case is like when new user joined into the company he will be requesting for laptop keyboard mouse webcam all these items&lt;/P&gt;&lt;P&gt;so if he selects all these consumables then when the request is closed complete then quantity of 1 will be reduced from the consumable table&lt;/P&gt;&lt;P&gt;so there is a chance he selects all items right&lt;/P&gt;&lt;P&gt;so in this case if else is not working&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 01:32:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821053#M194096</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-09T01:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821063#M194097</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; in this cases, instead of while/switch, create a run script and check all the variable value and store it in different scratchpad variables/activity result and in next run script you can check these&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if (current.variables.var_name == 'value1') {&lt;BR /&gt;activity.result = 'value1';&lt;BR /&gt;} else if (current.variables.var_name == 'value2') {&lt;BR /&gt;activity.result = 'value2';&lt;BR /&gt;}&lt;BR /&gt;else if (current.variables.var_name == 'value2' &amp;amp;&amp;amp; current.variables.var_name == 'value1') {&lt;BR /&gt;activity.result = 'value3';&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 02:10:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821063#M194097</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-09T02:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821087#M194098</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;By mistakenly the previous post was accepted. But in the run script below even the logs are executing and the branches are not going to next run script. It is getting struck there itself.Can you please guide&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Renu9_0-1707447389878.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328610i4F19C176FE1356D4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Renu9_0-1707447389878.png" alt="Renu9_0-1707447389878.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Renu9_1-1707447447116.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328611iE3235D25FE87E699/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Renu9_1-1707447447116.png" alt="Renu9_1-1707447447116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the show workflow in RITM&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Renu9_2-1707447528932.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328612iD6003C307142F257/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Renu9_2-1707447528932.png" alt="Renu9_2-1707447528932.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 02:59:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821087#M194098</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-09T02:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821096#M194099</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; your run script should look like this, tested in PDI returns result, I have 2 checkbox variables here.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarishKM_0-1707448629855.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328613i209DA89F9B6F6874/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarishKM_0-1707448629855.png" alt="HarishKM_0-1707448629855.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarishKM_1-1707448644203.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328614i28F7B59EACDCEE8A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarishKM_1-1707448644203.png" alt="HarishKM_1-1707448644203.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I selected both variables and output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarishKM_2-1707448670275.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328615iDF07E86D554A783A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarishKM_2-1707448670275.png" alt="HarishKM_2-1707448670275.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Selected single variable&lt;/P&gt;&lt;P&gt;Output&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HarishKM_3-1707448723036.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/328616iF49D6A27431BA1CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HarishKM_3-1707448723036.png" alt="HarishKM_3-1707448723036.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 03:20:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821096#M194099</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-09T03:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821150#M194100</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for it, but I want to keep different dynamic values for keyboard and mouse separately. So, in this case first if statement will not work right. And I am having 6 variables like keyboard, mouse, webcam, monitor, desktop, etc.&lt;/P&gt;&lt;P&gt;There will be multiple combinations .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My use case is the user can request any one of the item in those 6 or all those 6 or few of them.&lt;/P&gt;&lt;P&gt;For each variable it is with different dynamic values.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 05:15:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821150#M194100</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-09T05:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821587#M194104</link>
      <description>&lt;P&gt;Hi &lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/324218"&gt;@Renu9&lt;/a&gt; you can check the value of variable dynamically as well, what type of variables are you using? share more details on the variables so that i can help you with correct code&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 10:55:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821587#M194104</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2024-02-09T10:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass dynamic values to single run script based on if condition</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821913#M194113</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/399714"&gt;@Harish KM&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below are the variables&lt;/P&gt;&lt;P&gt;1.What kind of keyboard is needed?&lt;/P&gt;&lt;P&gt;2.What kind of mouse is needed?&lt;/P&gt;&lt;P&gt;3.What kind of webcam is needed?&lt;/P&gt;&lt;P&gt;4.What kind of monitor is needed?&lt;/P&gt;&lt;P&gt;5.What kind of laptop is needed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are few choices in all these variables. The user can request any one of these , multiple or all based on his requirement.&lt;/P&gt;&lt;P&gt;When keyboard is selected then the corresponding keyboard type from the consumable table if the stock is available then it has to be assigned to the requested user. For this, there is a script include. Same way for mouse, webcam, laptop, monitor ,etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If keyboard is selected then I want to fetch and store value for the keyboard consumable item in a variable. This value I have to pass it in run script. So, here if else wont work because the user can request multiple items.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, if user requests for keyboard, mouse and monitor and not webcam and laptop then one item for keyboard will be assigned to user and deducted from consumable table. Same way for mouse and monitor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2024 13:49:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/how-to-pass-dynamic-values-to-single-run-script-based-on-if/m-p/2821913#M194113</guid>
      <dc:creator>Renu9</dc:creator>
      <dc:date>2024-02-09T13:49:37Z</dc:date>
    </item>
  </channel>
</rss>

