# Commas in alias filter

**URL:** <https://forum.genieacs.com/t/commas-in-alias-filter/833>\
**Category:** Uncategorized\
**Created:** [June 9, 2020, 11:06pm UTC](https://forum.genieacs.com/t/commas-in-alias-filter/833 "2020-06-09T23:06:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebvif](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sebvif](https://forum.genieacs.com/u/sebvif)\
**Post date:** [June 9, 2020, 11:06pm UTC](https://forum.genieacs.com/t/commas-in-alias-filter/833/1 "2020-06-09T23:06:59Z")

</div>

Hello,  
I’m using a provision script to configure several instances of a hotspot service called CoovaChilli. There is a parameter that takes comma separeted values and I don’t know how to put that in the alias filter of the declare statement. Here is what i got:

`
function addNewProfile(profile) {
  return declare(path + `[` +
                 `Disable:,` +
                 `Net:${profile.net},`+
                 `UAMListen:${profile.uam_listen},`+
                 `UAMServer:${profile.uam_server},`+
                 `UAMAllowed:\'${profile.uam_allowed}\',`+
                 `UAMDomain:${profile.uam_domain},`+
                 `SSID:${profile.ssid}`+
                 `]`, {path:Date.now()}, {path:1});
}
`

The problem is that profile.uam\_allowed looks something like 8.8.8.8,4.2.2.2 and the declare function reads it as if I’m stating a new parameter. I have tried escaping it with backslash and putting it in single quotes but no success. I’d really appreciate any suggestion.

---

<div class="post-metadata">

**Author:** ![lavira](https://avatars.discourse-cdn.com/v4/letter/l/87869e/32.png) [@lavira](https://forum.genieacs.com/u/lavira)\
**Post date:** [June 10, 2020, 6:43am UTC](https://forum.genieacs.com/t/commas-in-alias-filter/833/2 "2020-06-10T06:43:29Z")

</div>

Hi, just use double quotes … plus, I personally avoid string concatenation and use string templates, so you can rewrite the code like this:

```
function addNewProfile(profile) { 
return declare(`${path}[Disable:,Net:"${profile.net}",UAMListen:"${profile.uam_listen}",UAMServer:"${profile.uam_server}",UAMAllowed:"${profile.uam_allowed}",UAMDomain:"${profile.uam_domain}",SSID:"${profile.ssid}"]`, {path:Date.now()}, {path:1}); 
}
```

---

<div class="post-metadata">

**Author:** ![sebvif](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@sebvif](https://forum.genieacs.com/u/sebvif)\
**Post date:** [June 10, 2020, 12:32pm UTC](https://forum.genieacs.com/t/commas-in-alias-filter/833/3 "2020-06-10T12:32:13Z")

</div>

Thank you very much. It worked perfectly.
