Skip to main content
August 13, 2024
Question

You are referencing and using arrays of a CDT (Custom Data Type). Which two statements are true? (Choose two.)

  • August 13, 2024
  • 8 replies
  • 0 views

You are referencing and using arrays of a CDT (Custom Data Type). Which two statements are true? (Choose two.)

A. Other Appian functions can be used within the square brackets "[]" when using dot notation to return specific data from the array.

B. There is no difference between using "dot notation" and the index() function.

C. An array of integers can be passed as the second parameter to the index() function to return the data at those position in the array.

D. The function where contains can act on operands of different types.

I think options B and C are correct. Option D is incorrect. However, option A is not clear to me.

The following code does not give any error:

Hence, is option A correct? If that is the case, which one is incorrect?

8 replies

prasantap0900
August 13, 2024

Hi,

 the context of option A, I think the statement is not correct.

yogip3177Author
August 13, 2024

An array contains four elements {11,"test","abcd", 14} and the 4th element is 14. Hence, it returning the correct result. I don't see any issue with the result.

prasantap0900
August 13, 2024

I think "length" function is working like that. If it is working, length will be 4.

csteward
August 14, 2024

A and C are correct, B and D are incorrect.

mikes0011
Brainy
August 14, 2024

B is, as mentioned, incorrect.

The reason why: using index() gets the location of an array, returning a separate copy of that data (if any).  Square brackets refer directly to that position in the array, and can be used to access the value and also change the value within the original array (i.e. via an a!save() statement).

yogip3177Author
August 15, 2024

 [mention:124cfac3ed754d2d8c4a043c0b4591cf:e9ed411860ed4f2ba0265705b8793d05] & [mention:b45a4f6a20b14a008e4e0ec732a8bf98:e9ed411860ed4f2ba0265705b8793d05]  Thank you for your valuable comments.