Finditem Fails to Detect Valid List Member

tscott
Certified Master Anaplanner

Finditem Fails to Detect Valid List Member

Hi Anaplan,

 

I've come across something strange and wanted to ask if anyone has any ideas what is going on or if this is a bug.

 

I am creating a List using a Saved View that contains a list of codes (text) to be added to a list.

 

The import action is set to use code only, and the source codes are imported into both Name and Code of the target list.

 

The weird part comes after the list has been created and I try to use Finditem() on the list code to return the list item. For all codes, this works (as shown below) except if the code contains a space before a pipe:

If the list code = LS

Finditem(list, code) = LS

 

If the list code = LS|

Finditem(list,code) = LS|

 

If the list code = LS |

(with a space between "LS" and "|")

Finditem(list,code) = BLANK

 

I've no idea why for some reason Finditem() does not work on the code with a space before the "|" but this appears to be the case.

 

Is this a bug related to special characters or am i missing something?

 

Thanks

 

Tom

 

 

7 REPLIES 7
LeonardiT
Contributor

Re: Finditem Fails to Detect Valid List Member

Hey Tom,

 

Did a mock up based on your info. Didn't manage to reproduce your issue.

Are you doing anything different prior to the finditem formula?

Please find the screenshots below.

Screenshot 2021-06-27 at 8.50.47 PM.pngScreenshot 2021-06-27 at 8.51.09 PM.pngScreenshot 2021-06-27 at 8.51.21 PM.pngScreenshot 2021-06-27 at 8.50.59 PM.png

tscott
Certified Master Anaplanner

Re: Finditem Fails to Detect Valid List Member

This is really odd. 

 

I'll explain everything I did to see if you can spot any differences/ errors i may have made:

 

Created a line item (Line item3) of two text line items, one contained "LS" and the other BLANK

 

Formula: Line item1 & " | " & Line item2 = Line item3

 

Line item3 is used as Code and Name into a non-numbered list importing as saved view. Line item3 = LS | 

 

created the list item from this saved view

 

Finditem(list, line item3) = BLANK

 

While writing this it appears there may be an issue with the space after the pipe. When a code is created does it ignore spaces at the end of the string? if so the finditem() will be looking for the space which has been automatically removed from the code... Could be what is happening here. Maybe you could try adding a space to the end of your pipe (" | ")?

 

I really appreciate you looking into this for me to such an extent!

JussiLi
Frequent Contributor

Re: Finditem Fails to Detect Valid List Member

Hi, 

In my opinion Anaplan automatically removes spaces which are at the end of string; from list names, codes, line item names etc. 

 

-Jussi

JussiLi
Frequent Contributor

Re: Finditem Fails to Detect Valid List Member

Hi, 

Is it possible that either list code or text (that you are using in finditem) has some other whitespace character than space, and therefore they are not matching?

I would check this by manually removing blank from the code or the text and then adding space to it. 

 

-Jussi

tscott
Certified Master Anaplanner

Re: Finditem Fails to Detect Valid List Member

I don't think this is it but appreciate the thinking; I am performing the finditem() on the same line item that was used to build the Code and Name!

ChrisHeathcote
Community Boss

Re: Finditem Fails to Detect Valid List Member

@tscott 

I think the issue is in the creation of the list.

Try using "_" rather than a blank space.

 

Chris Heathcote
Bedford Consulting

Gold Partner and Regional Partner of the Year 2021, EMEA
MarkWarren
Expert

Re: Finditem Fails to Detect Valid List Member

The import does strip away spaces, either before or after the text, even when using text delimiters on a file.
I would suggest using a TRIM on the value you use in the FINDITEM.

msedge_2021-06-29_11-55-03.png

With TRIM:msedge_2021-06-29_11-55-30.png