Table of contents
TOC
Collapse the table of content
Expand the table of content

List.PositionOfAny

Owen Duncan|Last Updated: 4/19/2018

About

Finds the first occurrence of any value in values and returns its position.

List.PositionOfAny(list as list, values as list, optional occurrence as nullable number, optional equationCriteria as any) as any  

Arguments

ArgumentDescription
listThe List to check.
valuesThe list of values to check for.
optional occurrenceAn enum that controls the scope of operation.
optional equationCriteriaAn optional equation criteria value to control equality comparisons. For more information about equality comparisons, see Parameter Values .

Occurrence settings

SettingDescription
Occurrence.First and Occurrence.LastReturns a single position.
Occurrence.AllReturns a list of positions with all occurrences.

Remarks

  • If the value is not found in the list, -1 is returned

Examples

List.PositionOfAny({"A", "B", "C", "D"}, {"B", "C"}) equals 1  

List.PositionOfAny({"A", "B", "C", "B", "A"}, {"A", "B"}, Occurrence.First) equals 0

List.PositionOfAny({"A", "B", "C", "B", "A"}, {"A", "B"}, Occurrence.Last) equals 4  
List.PositionOfAny({"A", "B", "C", "B", "A"}, {"A", "B"}, Occurrence.All) equals {0, 1, 3, 4}  
© 2018 Microsoft