New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Appian ACD101 Exam - Topic 6 Question 41 Discussion

Actual exam question for Appian's ACD101 exam
Question #: 41
Topic #: 6
[All ACD101 Questions]

Review the following code snippet:

displayvalue(1, {0, 1, 2}, {"Low", "Medium", "High"}, "Unknown")

The definition of displayvalue is:

Tries to match a value in a given array with a value at the same index in a replacement array and returns either the value at the same index or a default value if the value is not found.

What does this code snippet return?

Show Suggested Answer Hide Answer
Suggested Answer: B

The displayvalue() function matches a given value with an array and returns the value at the same index from a replacement array or a default value if not found. In the snippet displayvalue(1, {0, 1, 2}, {'Low', 'Medium', 'High'}, 'Unknown'), the value 1 is matched in the array {0, 1, 2} at index 1. The function then returns the value at index 1 in the array {'Low', 'Medium', 'High'}, which is 'Medium'. Reference: Appian Expression Language Documentation - Functions


Contribute your Thoughts:

0/2000 characters
Thaddeus
9 hours ago
It defaults to Unknown if not matched.
upvoted 0 times
...
Cassi
6 days ago
Medium makes sense. 1 is at index 1.
upvoted 0 times
...
Kip
11 days ago
No, it’s Medium. Index 1 corresponds to 1.
upvoted 0 times
...
Erasmo
16 days ago
I agree, it should be Low. 1 matches index 0.
upvoted 0 times
...
Oliva
21 days ago
I think it returns Low. The index is 0.
upvoted 0 times
...
Quinn
26 days ago
I didn't expect that! Thought it would be "High".
upvoted 0 times
...
Tenesha
1 month ago
Wait, are you sure? I thought it would return "Medium".
upvoted 0 times
...
Sylvie
1 month ago
The answer is definitely B) Medium. It's right there in the function definition - it's supposed to return the value at the same index as the matched value in the second array.
upvoted 0 times
...
Adelaide
1 month ago
Haha, this question is a real brain-teaser! I'm going to go with B) Medium, but I'm not 100% sure. Maybe I should have paid more attention in class instead of doodling on my notebook.
upvoted 0 times
...
Shantay
2 months ago
This is a tricky one, but I think the correct answer is A) Low. The function is supposed to return the default value "Unknown" if the value is not found, and since the first parameter is 1, which is not in the second array, it should return "Low".
upvoted 0 times
...
Carma
2 months ago
I'm pretty sure the answer is C) High. The function is supposed to return the value at the same index as the matched value, and the index of 2 in the second array corresponds to "High".
upvoted 0 times
...
James
2 months ago
The answer is clearly B) Medium, since the second parameter in the displayvalue function is an array with the values 0, 1, 2, and the third parameter is an array with the corresponding values "Low", "Medium", "High".
upvoted 0 times
...
Micheline
2 months ago
Totally agree, it's definitely "Low".
upvoted 0 times
...
Lawana
2 months ago
It returns "Low" since 1 matches index 1.
upvoted 0 times
...
Alberta
3 months ago
I’m confused. What if it’s not found?
upvoted 0 times
...
Layla
3 months ago
Nope, it's definitely "Low".
upvoted 0 times
...
Bulah
3 months ago
I'm not sure about this one. The question says the function returns either the value at the same index or a default value if the value is not found. But the value 1 is found in the array, so I'm not sure why the default value "Unknown" would be returned. I'll have to re-read the function definition more carefully.
upvoted 0 times
...
Terrilyn
3 months ago
Okay, let me walk through this step-by-step. The function is trying to match the value 1 in the array {0, 1, 2}. Since 1 is at index 1, it should return the value at index 1 in the replacement array, which is "Medium". I'm confident that's the right answer.
upvoted 0 times
...
Millie
4 months ago
Hmm, I'm a bit confused. Does the function return the value at the same index as the match, or the actual value that was matched? I need to think this through more carefully.
upvoted 0 times
...
Mozell
4 months ago
I think this code snippet is returning "Medium" since the value 1 matches the index 1 in the replacement array.
upvoted 0 times
Lenita
2 months ago
I believe it returns "Medium" too.
upvoted 0 times
...
...
Marguerita
4 months ago
I’m confused about the index matching; I thought it would return "High" since it’s the last index.
upvoted 0 times
...
Claudia
4 months ago
I practiced a question like this, and I believe it returns the value at index 1, which is "Medium".
upvoted 0 times
...
Vilma
4 months ago
I'm not entirely sure, but I remember something similar where the index was crucial. Could it be "Medium"?
upvoted 0 times
...
Ricki
5 months ago
I think the function checks the first argument against the array, so it should return "Low" since 1 matches index 1.
upvoted 0 times
...

Save Cancel