Using the same label for applying filters on two different fields


#1

Hey guys, I’m having some issues when using the same labels in two fields, according to the documentation if you want to apply the same filter from two different fields you just need to use the same label, but for some reason that is not working for me, any recommendation?


#2

Hey @ralf if you are using two fields with the same label in order to apply filter across two sources it should work properly, in order to give you a better solution i need to see your metadata definition or a code fragment, you know, something to review and understand your problem.


#3

Ok @emoya, this is my metadata:

let _META_ = {
    "company_clinets_source": {
      "fields": {
        "local_client_id": {
            "label": "Client id",
            "type": "ATTRIBUTE"
        },
		"global_client_id": {
            "label": "Client id",
            "type": "ATTRIBUTE"
        }
      }
    }
}

As you can see the label is the same Client id


#4

Ok @ralf i see :eyes: the problem, you are not using the labels properly, you are defining the same label for two fields but they are in the same source, that shouldn’t work and that’s not the idea, the idea is define the same label for two or more fields in different sources like this:

let _META_ = {
    "company_clinets_local_source": {
      "fields": {
        "local_client_id": {
            "label": "Client id",
            "type": "ATTRIBUTE"
        }
      }
    },
    "company_clinets_global_source": {
      "fields": {
        "local_client_id": {
            "label": "Client id",
            "type": "ATTRIBUTE"
        }
      }
    }
}

Now, if you want to define labels for both fields, you just need to add an space or some different character in the label string, just remember that the concept of the same label for different fields is for filtering across different sources.


#5

Ho brooo!! I see the problem 🥲, thanks for that explanation @emoya, now i know how to deal with this properly


#6

No worries, we are here for help, :sunglasses: