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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Display associated val...
Power Pages
Unanswered

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,340 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard