web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Display associated val...
Power Pages
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:
I have the same question (0)
  • Fubar Profile Picture
    8,497 Super User 2026 Season 1 on at

    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/

  • Verified answer
    MartinVargas Profile Picture
    312 on at

    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.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 42

#2
Valantis Profile Picture

Valantis 24

#3
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard