Get Multiple Values by Indexes
Last updated
Last updated
This ‘Get Multiple Values by Indexes’ is pre-built Action located under the List captured Element. It instructs the Avo Assure client to get multiple values from the list based on the input values and store the result in the output variable.
Input: <Index 1>;<Index2>;..…etc.
Note : In the above syntax, Index1 starts with 0, which means 0 is considered the first index.
Output: <Dynamic Variable> ;<Dynamic Variable>(Optional)
Scenario:
Consider a scenario where you are testing an online shopping application that displays a list of available products in a particular category. Here you have to fetch specific products based on their position (index) in the list. For example, the user wants to view the details of the second, sixth, and ninth Product from the list.
Input: As input = 2;6;9
Expected result: This action needs to fetch the value based on the index which is specified in input and store the result in the output variable. To fetch the2st, 6th, and 9th values based on 1-based indexing (as in the input user provided), user would need to think index start with 0.
The 3nd value corresponds to index 2.
The 7th value corresponds to index 6.
The 10th value corresponds to index 9.
This will give us the 2nd, 6th, and 9th values from the list (it will consider 0-based indexing). Output: The action fetches the values based on the given index, and the result is stored as ‘Mixer Grander, TV, AC’ in the output variable {Display Products}.