N
Novuβ€’7d ago
Gaia

Hide workflows for specific users in Preferences component

Hello! Is there any way to hide a workflow for specific users? Let's say I have two workflows "workflow A" and "workflow B" and a user with a specific property (in this case the subscription plan on our project) should be able to see only workflow A or workflow B in the Preferences component based on the subscription plan he has. We also check for the subscription plan in the execution of the flow, so I could hide the workflow just VISUALLY and that would be fine. Thanks a lot! G.
14 Replies
Dima Grossman
Dima Grossmanβ€’7d ago
Hi @Gaia this is currently can be possible using the tags filter for preference: https://docs.novu.co/inbox/react/components/inbox#filter-visible-preferences You can mark the Premium or Base tier workflow with a special tag and filter them conditonally on the UI depending on the user
Novu
- Novu
Gaia
GaiaOPβ€’7d ago
Thank you very much! I thought I had read everywhere on the docs but I must have skipped this part without realizing it πŸ˜…
Dima Grossman
Dima Grossmanβ€’7d ago
Where would you most expect to see this information on the docs (page or section)?
Gaia
GaiaOPβ€’6d ago
I guess I was looking for it in the Workflow page of the docs or in the "Preferences" page inside the Inbox section
Dima Grossman
Dima Grossmanβ€’6d ago
thanks for the feedback! Going to update this
Gaia
GaiaOPβ€’6d ago
That's great, thanks!!
Novu_Bot
Novu_Botβ€’6d ago
@Gaia, you just advanced to level 1!
Gaia
GaiaOPβ€’6d ago
Sorry @Dima Grossman do I have to set the property preferencesFilter in the Inbox component even If I'm separating the Preferences from the Inbox? I tried conditionally like this:
return (
<>
{subscriberId && (
<Inbox
subscriberId={subscriberId}
applicationIdentifier={import.meta.env.VITE_NOVU_APP_ID}
routerPush={(path: string) => router.push(path)}
preferencesFilter={{ tags: hasReputation ? ['reputation_basic'] : hasReputationPro ? ['reputation_pro'] : ['test_push'] }}
>
<Preferences />
</Inbox>
)}
</>
);
return (
<>
{subscriberId && (
<Inbox
subscriberId={subscriberId}
applicationIdentifier={import.meta.env.VITE_NOVU_APP_ID}
routerPush={(path: string) => router.push(path)}
preferencesFilter={{ tags: hasReputation ? ['reputation_basic'] : hasReputationPro ? ['reputation_pro'] : ['test_push'] }}
>
<Preferences />
</Inbox>
)}
</>
);
` But I can still see all the workflows (even the one with tags not specified in the filter).
Dima Grossman
Dima Grossmanβ€’6d ago
Hi @Gaia let me try to replicate this locally Seems like an issue on our end, team is checkign this
Gaia
GaiaOPβ€’6d ago
Thank you very much, I'll wait for you updates πŸš€
Pawan Jain
Pawan Jainβ€’5d ago
@Gaia Our team is working on fix
Dima Grossman
Dima Grossmanβ€’5d ago
@Gaia a fix was deployed to our cloud instance, could you please re-try this?
Gaia
GaiaOPβ€’4d ago
Just tested and working fine now! Thanks πŸ’― πŸ™
Want results from more Discord servers?
Add your server