Hi All. I recently started using Growthbook and I’...
# ask-questions
f
Hi All. I recently started using Growthbook and I’m in the process of setting up some of my first features. Right now I’m just testing in our staging environment and setting up some force rules. When I use
id is equal to
it works as expected but when I use
id is in the list
, the users in the list are not being served the correct feature. Has anyone else experienced this and/or does anyone have tips to get this working? Thanks!
f
Hi Melissa. Can you click the "advanced" mode when entering targeting conditions and see if it's parsing everything correctly into JSON?
f
Yes I tried that and it looks right to me. Here is a screenshot.
f
Hmm. What SDK are you using?
f
We’re using the React SDK
"@growthbook/growthbook-react": "^0.8.1",
f
Are the ids you are passing into the SDK strings or numbers?
f
They’re numbers
f
Ok, that's probably the issue then. In GrowthBook, under Settings -> Attributes, you can change the data type of id to be Number so it matches what you are passing into the SDK
After that, if you edit the rule and then save it, it should store the condition as this instead:
Copy code
{
  "id": {
    "$in": [
      762,
      2891
    ]
  }
}
f
Let me try that out! Thanks for your help!
Interesting that it works as a string when it’s just one user id with is equal to though
f
yeah, the javascript SDK must not be doing strict comparison for that operator. We should probably fix that
f
Thanks so much for the quick response though. Really liking Growthbook so far! 🙂
Changing the id type to number seems to be working - thanks!