User attribute value's order changing

Under user attributes, we have a key called department and we want to pass multiple values for that key in a specific order, we used ## as a delimiter as suggested by stack overflow forum. The delimiter is working fine but the order of the text changes each time you append or change the values. The order of the value is important because it is used to set priority .
Is there any way to keep the order or any better approach to solve this. Please advise.

Keycloak version is 15.0.2