cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrittanyR
Helper III
Helper III

Have a form with read only fields filled dynamically

I want to have a form where I fill the value for some fields in it (for them to be read-only) dynamically. So I want to pass a query string for the department ID, and when I fill a new value for the programmer, I want to add a new entry in the programmer entry with a reference to that department. If I add a new component from the left side and choose form, am not able to do this. Any hint or idea how to do this would be great. I'm still new to PowerApps portals. 

1 ACCEPTED SOLUTION

Accepted Solutions

you are better off setting the lookup read-only via JS 

 

$('#<lookup name>').siblings("div.input-group-btn").find("button").prop("disabled", true);
$('#<lookup name>>').siblings("div.input-group-btn").hide();

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

View solution in original post

20 REPLIES 20
v-xida-msft
Community Support
Community Support

Hi @BrittanyR ,

Could you please share a bit more about your scenario?

Do you want to fill in value in several "Read-Only" fields within the Entity form based on the passed the department ID query string value?

 

Regarding the needs that you mentioned, I think the combination of JavaScript code and Liquid expression in PowerApps Portal could achieve your needs.

 

Please check and see if the following blog or article would could help in your scenario:

https://www.briteglobal.com/blogs/community/pass-parameters-between-entity-forms/

https://www.cloudfronts.com/prepopulating-lookup-dropdown-fields-form-d365-crm-portals-using-js/

 

https://community.dynamics.com/365/f/dynamics-365-general-forum/307149/portals---populate-a-contact-...

https://www.dancingwithcrm.com/custom-lookup-filtering-powerapps-portal/

 

Liquid expression in PowerApps Portal

Use Javascript code in PowerApps Portal Entity form

 

Please try above solution, hopes it could help in your scenario.

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-xida-msftThanks for your reply. 

 

I'm having these issues: 

 

1- Whenever I configure my form (Main) for my entity, add the fields I want, save it, publish. I go to my Portal, Sync Configuration, add the form as a component to a page, it doesn't show up as I configured it, it shows only the Name field, with the Status Reason (which am not even using) appearing as a label. Basically the form is just corrupted. 

2- What I'd like to have, is for example, I have a department, on the department I want to click on "Add developer", so it would send me to a page with a form for adding a developer. In the "Add Programmer" form, I want to have the name of the department appearing as a label in the form itself (so when it's added, it's added as a lookup to the Department entity) because I have the Department as a lookup in the Programmer entity. So I'd like to have a the programmer form, appearing on the page, with all the fields, except for the "Department" field as read-only, filled from the query string with ID of the chosen Department. 

 

So when I click on "Add programmer" button on the department page, I transfer the user to a new page with the Add Programmer form with a query string having the ID of the department. Is there a way to do that with Power Apps Portals? I am not even able to add the "Add Programmer" form to the page, it doesn't look like what I have it configured in the entity itself. 

 

3- My third issue is, can I save an attachment for each entity? For example, to upload the resume for each programmer, is there a way to do that? 

 

 

 
 

 

Hi @BrittanyR

For 1st Issue:

1- Whenever I configure my form (Main) for my entity, add the fields I want, save it, publish. I go to my Portal, Sync Configuration, add the form as a component to a page, then Sync Configuration. it doesn't show up as I configured it, it shows only the Name field, with the Status Reason (which am not even using) appearing as a label. Basically the form is just corrupted.

 

You have to sync configuration after add your form into page.

 

For 3rd Issue:

You can add NOTES section in the form and attach document into particular record.

 

--------------------------
If you like this post, give a Thumbs up. Where it solved your query, Mark as a Solution so it can help other people!

Hi @BrittanyR 

from what I understand, all your requirements you can achieve with Power Apps Portals, let's go:

 

1 - this is an issue that for some reason the Portals can't find your form, and it doesn't render it properly, I am not really sure why it happens but to fix all you need to do is rename the form in your solution

these days we had a Portals Community Call and I talked about this specific issue, take a look at the video if you have some time, it's probably in the end, maybe around 45 minutes of the video: https://www.youtube.com/watch?v=ky4X7chwl1I 

 

2 - is "Developer" a subgrid? that's fine and you can add a related record, just note that the sub-grid won't appear if your "Department" entity form is in Insert mode, this is an expected behaviour as we need the parent record ID to associate any child record.. if your form is already in Edit mode, is fine.. but if you are creating a new Department, I would suggest you look at options like Web Form, or still use Entity Form but after create the record you need to redirect to another Edit mode Entity Form.. so it's up to you

In your CDS form for Developer, you can leave the Department field as read-only (in my opinion you don't even need to show that in the form.. but at a first instance, just leave read-only).. then for your "Developer" Entity Form, you need to add an Entity Form Metadata related, and add the subgrid/create settings.. the Portals will automatically associate the parent and child record

 

3 - yes, in your developer Entity Form you need to enable notes attachment (you also need to make sure the entity in your CDS has notes enabled): https://docs.microsoft.com/en-us/powerapps/maker/portals/configure-notes

 

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

@BrittanyR did that help solving your issue? can you mark as the answer so it helps other users?

 




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Hi @OliverRodrigues I created a new form in my entity, I sync the config, but I don't find this form in the list of forms when I add the form component. 

 

I might be understanding this the wrong way, but I don't see the form name in the list of forms, I don't even get to select the form by name, I have a drop down to choose "Create new" or "Use existing", then I can choose the entity, then "form layout", I get "main form" or "Information", however I have more than one Information form with different names, how do I choose the form I need? Is it me or is it buggy? 

 

 

 

 

@OliverRodrigues  Watching some videos online, I would expect to see my custom form in the "Form layout" dropdown, however I don't really see it, I only see the "main form" and "Information" options. When I go to my solution, then to my entity, I can see the "Add Programmer Form" in the list of forms for that entity, with the form type as "Main". Isn't this what I am supposed to do?

 

I keep syncing config, but no luck. 

 

in your solution, make sure you Publish your customizations

 

can you try the same steps you are doing in the Portal Management App, instead of using Portal Studio

 

go to make.powerapps.com --> apps --> portal management app --> Entity Form and create/update your entity form there, see if the options are refreshed there




If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User


Oliver Rodrigues


 

Thanks @OliverRodrigues That did it! Didn't know that I can use the entity forms from that location. 

 

For the read-only lookup. I am passing an ID to my form in the query string. This ID is for the parent entity. For example, the form is for adding a new programmer, however the ID is for the department, so I'd like the user to see in the "Department" the name of the department, but for it to be disabled and populated from the query string. You mentioned something in a previous comment about a "subgrid" but am not sure what that means :s I did it using the relationship between the programmer entity and the department entity as many to one relationship. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,802)