Segment based on current users email stopped working

Feature(s) impacted

Segments

Observed behavior

Our segments that are based on a filter to the current users email using $currentUser.email has stopped working. We haven’t changed anything on our side. I noticed that the request going to the backend has the following filter: {“field”:“InternalAssessor”,“operator”:“equal”,“value”:“$currentUser.email”}. Should the frontend be replacing $currentUser.email with the current users email or does the backend handle that? Either way this is no longer working and the backend is returning no results.

Expected behavior

The segment should return records where InternalAssessor is equal to the current users email

Context

  • Project name: Bridgement.1
  • Team name: Operations
  • Environment name: Production
  • Agent type & version: “forest-express-sequelize”: “^8.4.10”, “sequelize”: “6.6.2”
  • Recent changes made on your end if any: N/A

Hello @JoshBridgement,

Thanks for your message.

Hum actually this feature on segments was not really supposed to work properly and was not documented…
So when reworking some parts, we probably have broken this possibility.

Anyway, it would be great if it will be working fine and be documented.
I’ll come back to you as soon as we enable it again.

Thanks.

Thanks for the update. Do you perhaps know how long this would take? Currently we have a few internal staff who use their filtered segments for their day to day activities.

Thanks for the help.

Additionally, I believe there is mention of this feature in the docs here:

@JoshBridgement we just had a look, this feature should be available quite soon.
Hopefully early next week!

About the documentation, the link you shared is about Scopes and not Segments, that’s why it was not officially supported.
Anyway, let’s correct that up asap.

Okay understood thanks. Thats perfect :ok_hand:

1 Like

@JoshBridgement we just made a deployment to enable this feature on segments.

Could you refresh your browser and check if it’s working well on your side?

Thanks!

Hey @adriguy,

Unfortunately still not working

@JoshBridgement oh no, sorry to hear that!

I just made some tests on my side and it’s working fine.

Could you please give me a bit more details?
Can you check what’s sent in the filters parameter of the payload?
May you want to try to create a new segment with this dynamic filter to see if it works in that case?

Thanks a lot.

Sure, filters still has this: {“field”:“InternalAssessor”,“operator”:“equal”,“value”:“$currentUser.email”}

Should the frontend be substituting the value of $currentUser.email before sending the request?

We tried creating a new segment and got the same results.

@JoshBridgement thanks a lot for your quick answer.

Very strange, yes the frontend should be substituting the value.
Could you show me the settings of your segment?
Something like this:

1 Like

No problem - when I edited the segment now I noticed the “input code” helper on the right which changed the variable from $currentUser.email to {{currentUser.email}} and that seems to have fixed it!

Thanks for the help and for getting this officially supported on segments :slight_smile:

1 Like

Oh ok great news!

Thanks again @JoshBridgement and don’t hesitate if you have any other feedback/remarks.
Cheers!