- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 01:15 AM
Hi All,
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.
If mouse needed is selected as Yes, then in the run script , I want to consume a mouse record and assign to requester.
If Webcam needed is selected as Yes, then in the run script , I want to consume a webcam record and assign to requester.
So, for the keyboard, the item name is Ergo Keyboard 123, for the mouse, the item name is Mouse CPA1
So, I am thinking to use a single run script but pass these values from if condition to run script. How it is possible.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 06:09 PM - edited 02-08-2024 06:10 PM
Hi @Renu9 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
if (current.variables.var_name == 'value1') {
activity.result = 'value1';
} else if (current.variables.var_name == 'value2') {
activity.result = 'value2';
}
else if (current.variables.var_name == 'value2' && current.variables.var_name == 'value1') {
activity.result = 'value3';
}
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 06:59 PM
Hi @Harish KM 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
Please find the screenshot
From the show workflow in RITM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 07:18 PM - edited 02-08-2024 07:20 PM
Hi @Renu9 your run script should look like this, tested in PDI returns result, I have 2 checkbox variables here.
I selected both variables and output
Selected single variable
Output
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2024 09:15 PM
Hi @Harish KM
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.
There will be multiple combinations .
My use case is the user can request any one of the item in those 6 or all those 6 or few of them.
For each variable it is with different dynamic values.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 02:55 AM
Hi @Renu9 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
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2024 05:49 AM
Hi @Harish KM
Below are the variables
1.What kind of keyboard is needed?
2.What kind of mouse is needed?
3.What kind of webcam is needed?
4.What kind of monitor is needed?
5.What kind of laptop is needed?
There are few choices in all these variables. The user can request any one of these , multiple or all based on his requirement.
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
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.
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.