G'Day you clever folks,
The puzzle is that a simple IF() statement produces unexpected results and I cannot determine why.
The code fragment below illustrates the puzzle.
I expected If(Len( Last(FirstN(myNumberedCollection,r1)).Result) = 3,1,0) to produce the number 1 if the Result was "Yes". Nope! WHY? What does produce predictable but to my mind puzzling results is the code below.
The collection, myNumberedCollection contains 60 2-column records. I search through the collection until I come to a record containing the word "Plant". It is the following record which contains the information I seek. The information could be, Yes, No, or Blank.
With(
{r1: LookUp(
myNumberedCollection,
StartsWith(Result, "Plant"), RowNumber + 1)
},
If (Len( Last(FirstN(myNumberedCollection,r1)).Result) <> 3,1,0)
)
Can someone explain the reason please? I have spent a few hours coming to this puzzling solution. I fear my understanding of these PowerApps elements is faulty and will cause me further grief in the future.
Thank you for any help.
Signed: Puzzled (aka Chris)