ltrim not behaving as expected

Options
I have an ltrim, with a concat filter that doesn't work as expected whenever the value to apply the ltrim to starts with a t.

Whenever the value starts with a t, the ltrim also drops the t from the value even though the mask is not telling ltrim to drop the t.

For example, here's my input data before applying the ltrim, with the field to apply the ltrim to in the next step highlighted :[ltrimbug_input.png]Here's my config for the variable I am creating with the ltrim.[ltrimbug_config.png]My input:table = project

The end result I am expecting is that the new ltrim_var = type.

However, the output results in this :[ltrimbug_outcome.png]If I pass in a value in the field key of project.status, the result is correct, and status is presented in the variable.

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    It looks like you are mixing up the value and the mask.

    Your mask should be empty to include the default whitespace characters.

    https://mrkr.io/s/6260fcfa1e1f6f52f3b9b639/0
  • espptyltd
    espptyltd Member
    Options
    Thanks for the response .

    I'm not sure I understand why you are suggesting to leave the mask blank.

    My understanding is the mask is used to determine exactly what characters should be trimmed from the left of the value ( in my case the Type_Find_Array.field ).

    I am not trimming whitespace; I am wanting to trim the word project. from the field value to end up with type, or any other value that might be in the field key.

    As mentioned, the operation works perfectly well when my value isn't type, as per the following example :
    [image.png] 
  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    Ah that helps clarify.

    The mask is a list of characters that get trimmed. They are not in any particular order and are evaluated each time for any character on the left until nothing gets trimmed any more.

    Since the word project has a t in it, it means it gets the first character from type.

    It sounds like you want a replace filter instead. Technically you want replace first expression from the left starting at the beginning but since "project." Is fairly large you probably can just use the standard replace filter.
  • espptyltd
    espptyltd Member
    Options
     Thanks for the response and the clarification on how the mask works for ltrim.

    I've implemented replace, and it works as expected. Thanks for your help!

    FYI, here's my final config ( I was trying to do this originally in a loop but couldn't debug the filter in the loop hence my original screenshots outside of the loop )[image.png]