Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Answered

Display associated values in a form

(0) ShareShare
ReportReport
Posted on by 312

Hello community, I am working with a portal in power apps.

 

In a form for sending a contact, the values are being associated in the corresponding columns "Client" and "Contact". However, by putting these fields in "Read Only" it is not inserting them in the dataverse:

 

MartinVargas_0-1662588163501.png

 

 

This is the Javascript that was used:

MartinVargas_1-1662588163510.png

 

Apparently in a publication they told me that it couldn't be done, but I don't doubt that it can. https://powerusers.microsoft.com/t5/Power-Apps-Portals/Language-setting-for-user/m-p/1500750

 

Can someone help me here?

Categories:
  • Verified answer
    MartinVargas Profile Picture
    312 on at
    Re: Display associated values in a form

    Hi @Fubar , apparently you can solve it using the following JS:

    $(document).ready(function(){
    
     var idContact = "{{user.contactid}}";
    
     var nameContact = "{{user.fullname}}";
    
     var idCompany = "{{user.parentcustomerid.id}}";
    
     var nameCompany = "{{user.parentcustomerid.name}}";
    
     /* Client */
     $("#customerid_name").attr("value", nameCompany);
    
     $("#customerid").attr("value", idCompany);
    
     $("#customerid_entityname").attr("value", "account" );
    
     
     $("#customerid_name").attr("readonly", true);
    
     $("#customerid_name").attr("aria-disabled", true);
    
     $("#customerid_name").attr("disabled", "disabled");
    
     $("#customerid_name").siblings("div.input-group-btn").find("button").prop("disabled", true);
    
     $("#customerid_name").siblings("div.input-group-btn").hide(); 
    
    
     /* Contact */
     $("#primarycontactid_name").attr("value", nameContact);
    
     $("#primarycontactid").attr("value", idContact);
    
     $("#primarycontactid_entityname").attr("value", "contact" );
    
    
     $("#primarycontactid_name").attr("readonly", true);
    
     $("#primarycontactid_name").attr("aria-disabled", true);
    
     $("#primarycontactid_name").attr("disabled", "disabled");
    
     $("#primarycontactid_name").siblings("div.input-group-btn").find("button").prop("disabled", true);
    
     $("#primarycontactid_name").siblings("div.input-group-btn").hide();
    
    });

     

     

    Thanks.

  • Fubar Profile Picture
    7,960 Super User 2025 Season 1 on at
    Re: Display associated values in a form

    If the fields are marked readonly on the Dataverse form then Dataverse is not expecting it to be updated and so it doesn't.

    You will need to make the fields editable on the Dataverse form and then set them readonly in JavaScript/JQuery on the Portal Form.  Different field types require different elements to be set readonly see this blog from Oliver  https://oliverrodrigues365.com/2020/08/16/power-apps-portals-javascript-tip-02-set-attributes-read-only/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >