How to pass multiple variables for a multi select in a request - servicenow

Basically I have a request that accepts multiple values and I want to send multiple via the API for now using rest api explorer. The Software is a multiselect as shown.

The fix for this ended up being turning the software request into an array by changing it to the following:
"software": [ "item1", "item2" ]

Related

How do I initiate a dynamic user prompt depending on an API response in Bot Composer?

I have an API response in which a field gives me an array of objects. I want to prompt the user to select which one of these objects in the array they want to see the details of. For example, if the API response has a field like:
"field":[
{"number":"101","name":"abc","value":"final output 1"},
{"number":"102","name":"xyz","value":"final output 2"}
]
I want the prompt/card to ask which number and name the user wants to choose, accordingly I want to show the corresponding value to the user. The number of objects in the array can vary. I would prefer if this prompt is in the form of an adaptive card like the one in the attached image, but any solution would do using bot composer's capabilities.
One viable solution would be to build a card in code. You can parse the response from the API and use it to create a card which can then be sent by the bot. Since this is Composer, you can look into creating a custom action to hold this logic.
As the user AP01 has said, one good solution to this problem is to do it inside the code. You can create a custom component that will execute C#(or nodejs if you use that) code in which you can then easily deserialize/parse/process that json array and create a custom card that will then be display to the user. That is how I did it.

How do I use a HL7 FHIR custom tag?

Idea:
I would like to store the change action on each version of my FHIR Patient resource. For example, when it is created, the action is 'Created'. By similar token, if the subsequent actions on the same resource are 'updated', 'deleted' and 'restored from deleted', the action of each version of the same resource will be 'Updated', 'Deleted' and 'Restored'.
Implementation:
We are thinking to put the 'Action' into a customer defined resource.meta.tag. An example is shown below.
"tag" : [
{
"system" : "hxxp://mydomain/fhir/custom_tag/SystemActionStatus",
"code" : "Updated"
}
]
Questions:
Is this the right usage and approach to use meta.tag for the system action idea? If not, what should I use?
Does FHIR allow custom meta.tag?
I tried to implement the above, but we got error when testing with a testing tool. Do I need to provide the code definition under hxxp://mydomain/fhir/custom_tag/SystemActionStatus such that a system can access the custom tag to find the definition of each code (created, updated, deleted and restored)?
Any suggestions or links are high appreciated.
No, I think there are better approaches.
If you need to communicate this data to other systems the FHIR way,
you can use the AuditEvent resource to capture this data.
If it's just for internal storage, you could use an extra database table,
and store it outside of the resources.
Yes
No, you don't have to do that. Check the error from server you sent this to, to see why you couldn't put the tag on the resource.

Passing whole body as a variable to a POST request

I'm trying to create a simple stress test using JMeter. I have mostly GET requests and a couple POST requests. My main goal is to make this test as reusable as possible. I want to implement it in a way that the user would have to provide a CSV file with the following headers:
method;path;postBody
The values would look something like:
GET;/path/to/resource;''
POST;/path/to/resource;'{"key":"value","key":"value","key":"value"}'
Now POST (PUT, PATCH etc ..) bodies differ from one request to another. Providing ${postBody} to Body Data tab does not work "${postBody}" as well.
Is there a way to achieve this? Command line solutions are more than welcome as well.
EDIT: To clarify, I'm using the UI interface. When I input ${postBody} in the Body Data tab the UI complains. When switching from the Body Data tab to another one I get the following prompt:
Remove "'" around the request and it should work.
Regarding the warning you get, it is not an error, it is just that in JMeter those 2 tabs are exclusive:
Parameters tabs is for input of parameters in the form as name=value
Body data is for your kind of requirement
So can you test my hypothesis which is to remove the quote around the request in CSV file ?
If it still fails, please show the logs.
You can remain in Body Data tab,
Add after pathPost your optional query parameters for GET request:
${pathPost}?${getPramaters}
Don't worry about the ? it's just seperate path from parameters
Also consider changing variable name to path, more suitable because it can be POST.
In JSON , seperate between values while in CSV default is also ,
I suggest you can your CSV delimiter, In CSV Data Set Config Choose different Delimiter as ; and add your data in CSV accordingly (remove extra ' characters):
POST;/path/to/resource;{"key":"value","key":"value","key":"value"}
Notice: Allow quoted data keep default value False

Is Jmeter allow to select the option/value from the dropdown list

In My application which I am testing there is a drop down and I have to select the option/value from the list, After selection the value there is a text field which get auto populated. So can we do the same in Jmeter.
Please share the experience if any body has done.
Thanks in advance!
This will be quite difficult.
Selecting the value from the dropdown list is easy. But then your application probably makes an AJAX request to the server to populate the other values. So you would have to :
set up a separate HTTP Request which simulates your AJAX request
parse the HTTP response for the variables you need
save them into jMeter variables
use those to populate your next page request (the form submit)
A much easier way is to use some test data which you already know, and just submit your form with those fields hardcoded into jMeter.

How can I log the value of a variable sent in an HTTP Request sent from JMeter, if the value was first read in from a csv file

I would like to read the exact value of a variable I use to pass through an HTTP Request. I first read in many values of variables using the CSV Data Set Config. For the username, it is in the form of an email address. So, I have a variable called "email" in the Data Set Config. In the actual HTTP Request, for "name", I call it "username". For the "Value" field for this same "username", I added a time() function to it like this so I would end up creating unique users in my tests:
${email}${__time()
When I view the "Request" in a View Results Tree, I can see my parameter is listed correctly:
username=email1%40email.com1390854377360
I do not care if this is correct in real world terms. I already know that is not a valid email. That is ok for now.
What I want to know is how can I log that email that I just created on the fly? I would like to not have to pull in the whole request every time also and then use some type of Regular Expression extractor. It just seems like there should be an easy way to do this.
I think there are 2 ways,
Beanshell Pre/Post processors : you can write custom code in which you can log all your variables in some custom log file
Simple data writer : you can configure it and check save url,save field names,save response data field checkboxes that will give you complete data but in that later postprocessing on result file is required to get all usernames (email in your case).
first approach is easier and allows you create your own logging format(easy to retrieve and use somewhere else).
second approach is somewhat tedious and requires post processing.

Resources