https://www.growthbook.io/ logo
c

clever-gold-88011

07/21/2023, 2:48 PM
Hello, I am having problems getting the %rollout to work on Growthbook with my React Native mobile app. It seems like all the users are able to see the feature and there are no users for whom the feature is turned off. I have the feature
default value
turned
on
by default and have the % rollout set as an override rule. after setting the attribute i'm using
getFeatureValue()
to read the value though this does not seem to work. Please advise.
s

swift-helmet-3648

07/21/2023, 4:54 PM
Hi @clever-gold-88011 In this case I believe you would want your defaultValue to be
off
and the override rule to have a value of
on
c

clever-gold-88011

07/21/2023, 7:21 PM
I have tried that and that doesn't work either, if I turn it
off
then it will have a value of
false
for all the users no matter the override rule telling it to turn on
s

swift-helmet-3648

07/21/2023, 7:29 PM
So the issue has to do with the rollout rule ... What is the attribute you are using to assign to users? And can you confirm users are setting their attributes client-side?
c

clever-gold-88011

07/21/2023, 7:32 PM
this is happening for both of the features I have
roullout rules
. for one of them i am using
id
and for the other i am using
deviceId
. yes I'm able to log and see that those attributes exist/have values
we are setting
id
on our side (so in our app) and
deviceId
is being set using
Expo Device
library
here's how i'm reading it:
Copy code
growthbook.getFeatureValue('my-flag', true)
f

fresh-football-47124

07/21/2023, 7:49 PM
is it possible you’re evaluating the feature before the attribute is set?
c

clever-gold-88011

07/21/2023, 8:56 PM
no, i'm setting the attribute on the initial loading screen of our app and evaluating on the screen after that
f

fresh-football-47124

07/21/2023, 8:56 PM
ah
I see the issue
if a user is not included in the rollout rule
they will fallback to the default value
which is also ‘on’
c

clever-gold-88011

07/21/2023, 8:57 PM
i'm including 100% of users, 25% on, 75% off
f

fresh-football-47124

07/21/2023, 8:57 PM
as a rollout or experiment rule?
can you share a screen shot of the rule?
c

clever-gold-88011

07/21/2023, 9:00 PM
Screenshot 2023-07-21 at 3.00.03 PM.png
f

fresh-football-47124

07/21/2023, 9:01 PM
can you test setting the default value to off?
c

clever-gold-88011

07/21/2023, 9:01 PM
I have. in that case the feature is off for 100% of users
f

fresh-football-47124

07/21/2023, 9:09 PM
for the SDK endpoint, can you share (or DM) the json object it’s returning?
3 Views