How to show CMS content based on logged-in user email in Webflow with search and filter options?

Post author
Clayton Edrington

Hi there - I'm looking to build a table (webflow cms) that only displays the cms content relative to whoever is logged in (i.e. only display table content that I have permissions to). This seems achievable via the "show content if logged in with plan" logic outlined in this post.

My question is, is this a feasible approach if the user will also want to search/filter the given content that they have permission to? We may have 25+ different users (plans) and each user may have hundreds of cms records to view/search/filter. This is mostly a sanity check before I go down the route of implementing.

Thanks in advance.

Comments

8 comments

  • Comment author
    Duncan from Memberstack

    Julian Galluzzo have we found solid solutions to implementing this? I'm wondering if your recent project using Finsweet filters might help? I.e. filter on the ID in a hidden field. 

    0
  • Comment author
    Julian Galluzzo

    Yes indeed! You can use this and it will only filter through the content they have access to. https://webflow.com/made-in-webflow/website/saved-finsweet-filters

    0
  • Comment author
    Clayton Edrington

    Thanks Julian Galluzzo! Could you help explain how this is working or how to implement on my own table? Apologies, I'm not getting what was done differently here by looking through designer. 

    0
  • Comment author
    Waqar Naqshbandi

    Hey everyone, Is there a way to filter CMS items by the logged-in user's email?

    I have a CMS item that has data from all the user's and I want to show that data on a single page/table, but each user should only see their own data.

    The ideal scenario would be if I could use their login email to create the filter/conditional visibility.

    0
  • Comment author
    A J

    Hey Waqar Naqshbandi, you can take inspiration from this memberscript to show relevant CMS items for the current logged in user and preferably remove the CMS items which are not relevant by customizing the memberscript shared.

    However, an easier and a bit more secure approach would be (if that seems fit for your use-case) to make use of member-specific pages via CMS collection templates that Webflow creates automatically for each collection. Hope this helps

    0
  • Comment author
    Huy Khiếu

    Hi, I used a different approach:

    • If you store the database on Airtable, you can call to Airtable API and fetch only the data you need to Webflow
    • If you store the database on Webflow CMS, you can call directly to Webflow API

    Why I used this method? Because the #44 script just change the css display to 'none'. So if there are a lot of records, issue will come like heavy loading. Also I want to make the data of user confidential from other user, so I dont want they can see the data on html.

    Another approach, you can also use Memberstack Json to store the data of users, then use javascript to read Json and display on Webflow.

    0
  • Comment author
    A J

    Hey Huy Khiếu, glad you found a workable solution. I would like to ensure that you are not exposing any of your API keys in the client-side code as its not a secure approach to apply.

    That being said, yes if its confidential data, rather than hiding it, its best to remove the element from the DOM as stated earlier and yes you could use Member JSON if it fits your use-case as well.

    0
  • Comment author
    Huy Khiếu

    Im using wized to handle that

    0

Please sign in to leave a comment.