Reference Fields - Multiple Clients

I am soooooo discouraged. I love the way my Client Portal LOOKS but the functionality is giving me the blues! I’ve created a portal where my clients should be able to log in and submit, review, or update a task, and review expenses, approve pending payments, etc. Unfortunately, it seems that the moment I find a fix to one problem, I discover a new one! I’ve posted one or two of my dilemmas here in this forum, but either no one has a solution, or the people who do haven’t seen my posts. I’m a ‘one-man-shop’ business with very little wiggle room in my budget, so although my coding knowledge is nil, I cannot afford an IT staff. I thought Wix Code was going to be just the solution I needed, but perhaps I was over zealous.
My most recent issue is this:
The ‘landing page’ of my Client Portal is a ‘dashboard’. The dashboard is comprised of elements which are viewable based on the Client Name associated with the user’s Profile. The Reference Field (‘Client Name’) determines which of the elements are displayed on a particular client’s dashboard. I have a client who will have multiple staff members using the portal. The dashboard is displaying perfectly for the first staff member who created a profile. But, the client who signed in most recently has an empty dashboard. I’ve tried changing the Reference field from the Client Name to the Client ID, but none of my efforts have yielded a desirable result.

Does anyone have a solution to this problem, or any of the others I’ve posted in this forum?

Hi Juanita,
Welcome to Wix Code :slight_smile:
Can you please share your site url so we can inspect ?

Roi

Thank you SO much for responding! I’ve fixed the issue with the Dashboard page by duplicating the same repeaters for each user. But unfortunately, this solution doesn’t fix the over-arching problem. As I’ve tried to capture in the screenshot below, my issue is that I’m unable to figure out how to grant members sharing the same Client ID access to data without creating a duplicate record for each member. Here’s a general overview of my structure:

  • Profile Database - Primary Key: Client ID (Contains the Client Name, Client ID and User ID for each member).

  • Transaction Database - Reference Field: Client ID (Contains details about transactions that need to be marked as ‘Approved’, ‘Paid’, or ‘Pending’)

  • Pending Payments & Transactions Dynamic Pages are both linked using the Profile dataset and Transactions dataset

  • Pending Payments Table - Filters: Client ID same as Profile dataset & Status does not contain ‘Paid’

  • Transactions Table - Filters: Client ID same as Profile dataset & Status contains ‘Paid’
    (BTW, I’ve tried duplicating the records so that both staff members with profiles can see the data, but that won’t work because any edits that are made only effect the record for that particular user. i.e. When User A marks an expense ‘Paid’, it does not remove the record from User B’s list of Pending Payments).

My Website Address: www.writeitrightsite.com
Screenshot: One Client ID - Multiple Users

Hi Juanita. Sorry I cannot help you and hope you get this issue quickly resolved. Reading this and another one of your posts from a few days (button issues) I think that perhaps you might be able to help me with a challenge that I am having setting up a client portal… If you have a moment, could you take a look at post I submitted here: https://www.wix.com/code/home/forum/questions-answers/second-unique-page-to-member-profile

let me know in case it is not clear and thank you so much in advance for any help you can lend!! Adam

Hi Juanita Taylor,
Looks like you need to use code.
For example, If you want to remove an item from database collection (by Client ID, User ID etc) use wixData.remove().
Here is a sample:

import wixData from 'wix-data';

    wixData.remove("Pending Payments", "yourUserId") 
    .then( (results) => { 
        let item = results;  
    }) 
    .catch( (err) => { 
        let errorMsg = err; 
    });

This article contains all methods to manipulate database collection.
Feel free to paste your code to consult.
Good luck!
Roi