If a merge code needs to access the ID of the first Customer in a Details object that uses 1-based indexing, which code is correct?

Study for the OmniStudio Developer Test. Focus with flashcards and multiple-choice questions, each with hints and explanations. Get ready for your exam!

Multiple Choice

If a merge code needs to access the ID of the first Customer in a Details object that uses 1-based indexing, which code is correct?

Explanation:
In 1-based indexing, the first element is at position 1. In OmniStudio merge expressions, to read a field from the Nth item in a Details array you use the pattern %Details:Entity|N:Field%. So, to get the ID of the first Customer, you place 1 as the index: %Details:Customer|1:ID%. Using 0 would refer to a non-existent first item in 1-based indexing, 2 would fetch the second, and 3 the third. If there are no customers, the expression would yield null. Therefore, %Details:Customer|1:ID% is the correct way to access the first Customer’s ID.

In 1-based indexing, the first element is at position 1. In OmniStudio merge expressions, to read a field from the Nth item in a Details array you use the pattern %Details:Entity|N:Field%. So, to get the ID of the first Customer, you place 1 as the index: %Details:Customer|1:ID%.

Using 0 would refer to a non-existent first item in 1-based indexing, 2 would fetch the second, and 3 the third. If there are no customers, the expression would yield null. Therefore, %Details:Customer|1:ID% is the correct way to access the first Customer’s ID.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy