# I want site member to add few more relevant details and upload supporting document after he/she is logged in

**URL:** <https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214>\
**Category:** Ask the community\
**Tags:** question, cms, wix-members-area, wix\
**Created:** [February 28, 2025, 5:20am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214 "2025-02-28T05:20:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Astha\_Goel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/astha_goel/32/106010_2.png) [@Astha\_Goel](https://forum.wixstudio.com/u/Astha_Goel)\
**Post date:** [February 28, 2025, 5:20am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/1 "2025-02-28T05:20:37Z")

</div>

I want site member to add few more relevant details and upload supporting document after he/she is logged in.

I am using WIX editor. I have added members area and already using account settings and profile. I need user to add his business details and upload supporting document.

I created a custom page with input elements and connected them to CMS. But once submitted and user re-logins, I want those fields data to be shown as read only fields like we do in account setting page.

---

<div class="post-metadata">

**Author:** ![canute](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/canute/32/9739_2.png) [@canute](https://forum.wixstudio.com/u/canute)\
**Post date:** [March 1, 2025, 9:14am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/2 "2025-03-01T09:14:23Z")

</div>

You have done almost everything, just do the below:

- Duplicate the section where you are collecting the information on the custom page that you have already created.
- Set the Dataset permission to read & write from write.
- Set the duplicated input fields to read-only from the settings.
- Connect the duplicated input fields to the same dataset (Mostly it would already be connected but advisable to perform a hygiene check).
- You will need to add a bit of code to check if the logged in user has already submitted the information, if yes collapse the data collection section and expand the read only section, else the other way.

---

<div class="post-metadata">

**Author:** ![Astha\_Goel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/astha_goel/32/106010_2.png) [@Astha\_Goel](https://forum.wixstudio.com/u/Astha_Goel)\
**Post date:** [March 5, 2025, 7:05am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/4 "2025-03-05T07:05:42Z")

</div>

Thanks a lot for the solution!!

I have duplicated the section and change the read / write settings. However,  
I am new to wix and have no idea where and how to code.  
Please help.

---

<div class="post-metadata">

**Author:** ![canute](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/canute/32/9739_2.png) [@canute](https://forum.wixstudio.com/u/canute)\
**Post date:** [March 5, 2025, 7:44am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/5 "2025-03-05T07:44:50Z")

</div>

Hi Astha,

```javascript
import wixData from 'wix-data';
import wixUsers from 'wix-users';

$w.onReady(async function () {
    // Get the currently logged-in user
    let user = wixUsers.currentUser;
    let userId = user.id; // Unique ID of the logged-in user

    // Reference to the dataset
    let dataset = $w("#yourDataset"); // Change 'yourDataset' to the actual dataset ID

    // Sections to be shown/hidden
    let inputSection = $w("#inputSection"); // The section where users fill the form
    let readOnlySection = $w("#readOnlySection"); // The duplicated read-only section

    // Collapse both sections initially
    inputSection.collapse();
    readOnlySection.collapse();

    // Check if the user is logged in
    if (!user.loggedIn) {
        // If user is not logged in, show input section (or redirect to login)
        inputSection.expand();
        return;
    }

    // Query the dataset to check if the user has already submitted data
    wixData.query("yourDatasetName") // Replace with the actual dataset name
        .eq("_owner", userId) // Finds records where the logged-in user is the owner
        .find()
        .then((results) => {
            if (results.items.length > 0) {
                // User has already submitted data, show the read-only section
                readOnlySection.expand();
            } else {
                // User has NOT submitted data, show the input section
                inputSection.expand();
            }
        })
        .catch((err) => {
            console.error("Error fetching user data: ", err);
            inputSection.expand(); // Show input section in case of an error
        });
});

```

### ✅ **What This Code Does**

- **Checks if a user is logged in** before showing the form.
- **Queries the dataset** to see if the user has already submitted data.
- **Expands the appropriate section** :
  - If data exists → show **read-only** section.
  - If no data exists → show **input** section.

* * *

### 🚀 **Next Steps**

1. **Replace** `"yourDataset"` with your actual **dataset ID**.
2. **Replace** `"yourDatasetName"` with your actual **dataset collection name**.
3. **Ensure** that the sections (`#inputSection`, `#readOnlySection`) are correctly linked in your page elements.

Let me know if you need any further clarification! 😊

---

<div class="post-metadata">

**Author:** ![Astha\_Goel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/astha_goel/32/106010_2.png) [@Astha\_Goel](https://forum.wixstudio.com/u/Astha_Goel)\
**Post date:** [March 11, 2025, 6:56am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/6 "2025-03-11T06:56:35Z")

</div>

On changing the permission of dataset to read & write, the form does not allow to input data. The input elements are frozen.

---

<div class="post-metadata">

**Author:** ![canute](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/canute/32/9739_2.png) [@canute](https://forum.wixstudio.com/u/canute)\
**Post date:** [March 11, 2025, 7:16am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/7 "2025-03-11T07:16:50Z")

</div>

Okay, here’s what you can do:

For the **inputSection** , add the same **CMS** to the page and set it to **write-only**. For the **readOnlySection** , connect it to the **second dataset** of the same CMS, ensuring it is **read-only**.

This should resolve the issue. Let me know if you need any further clarification!

---

<div class="post-metadata">

**Author:** ![Astha\_Goel](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/astha_goel/32/106010_2.png) [@Astha\_Goel](https://forum.wixstudio.com/u/Astha_Goel)\
**Post date:** [March 12, 2025, 7:14am UTC](https://forum.wixstudio.com/t/i-want-site-member-to-add-few-more-relevant-details-and-upload-supporting-document-after-he-she-is-logged-in/69214/8 "2025-03-12T07:14:12Z")

</div>

Thank you so much!! This resolved my problem.
