Hi @oussouss ,
You can execute this query using basic form metadata and with straightforward JavaScript code.
This allows you to auto-populate fields in the portal for the currently logged-in user.
First, create basic metadata within the form where you want to auto-fill the contact field. Ensure the metadata type is set to "Attribute."
For a clearer understanding, please refer to the screenshot provided below.

Then, For the "Company" field, you must implement logic during the form's loading process.
You'll have to provide hard-coded values within the script and assign these values appropriately.(You can provide the Dynamic values within the script)
For the lookup field, you'll be setting three distinct values:
$("#ts_CompanyName_Name").attr("value", CompanyName);
$("#ts_CompanyName").attr("value", CompanyNameID);
$("#ts_CompanyName_entityname").attr("value", "EntityName");
Please modify the above code as needed and insert it into the custom JavaScript section.
For a visual guide, kindly refer to the screenshot provided below.

Save and Sync the Website
Thanks!
Inogic Professional Services Division
Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!
Drop an email at crm@inogic.com
Services: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/