cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Inserting values into form fields

Hi,

 

So I have a "Contact Us" form on my portal. On the form there is a look-up field to another entity called "Unit".

 

When the contact form is submitted it will create a lead in CRM and that's perfect. But I want to attach the look-up name onto the contact form for the unit, so that when the form is submitted it will already have look-up to the unit in CRM.

 

When I go to the contact form on the portal I have the unit primary name (look up name) in the request parameter, so I have the name available, I'm just not sure how to insert the value onto the form without having the user doing it.

 

So to clear things out:

 

I have a portal for showing all my units (apartments). You can go straight to a "contact us" page from the landing page or the navigation panel and create a lead in CRM (this form does NOT have the unit field). If you go into the "Unit" page it will show you all the units. From where you can pick a specific unit and that will navigate to a new page with a lot more details for this particular unit. On this detail page I have created a button called "Book Viewing" which navigates to a second "Contact Us" form (this form has the unit field as a read-only - essentially this field could be all hidden when things are working properly). The "Book Viewing button" sends the unit's primary name (look-up name) to the second contact us form in the request params, so I have the look-up name available I just dont know how to insert the value into the form field?

 

I have been using liquid a lot and believe this might be the way to do this but I'm not sure how.

 

 

15 REPLIES 15
Highlighted

Hi @chleverenz ,

 

I'm not sure if I understand your latest post?

 

The request.params.id that it passed onto the Contact Us page is the ID of the specific unit record I need data from.

 

So for me to be able to retrieve these field values from this specific unit, I would assign it like this:

{% assign unit = entities['crc17_propertyunit'][request.params.id] %}

and then I can just "dot" into the different fields I need, ex:

 

Unit case no. : {{ unit.crc17_name }}
Size: {{ unit.crc17_size }} m2 (squaremeters)
Rooms: {{ unit.crc17_rooms}}
Address: {{ unit.crc17_streetname }}
City: {{ unit.crc17_city }}
Postcode / Zip Code: {{ unit.crc17_zipcode }}

 

Does it makes sense?

 

Please let me know if I misunderstood something. 🙂 

Highlighted
Helper II
Helper II

Highlighted
Impactful Individual
Impactful Individual

Hi @oml 

 

It seems that "Unit" field is read only field on the contact form.

To fill Unit fill, you need to pass below code:

$(document).ready(function(){
   $("#crc17_unit_name").attr("value","Unit Name");
   $("#crc17_unit").attr("value","fb34ba0e-879e-ea11-a813-000d3ab4f1b4");
   $("#crc17_unit_entityname").attr("value","crc17_propertyunit");
});

Parameter1:  unit.crc17_name

Parameter2:  ID of the specific unit record which is passed in url

 

$(document).ready(function(){
     $("#crc17_unit_name").attr("value","Paramerer1");
     $("#crc17_unit").attr("value","Paramert2");
     $("#crc17_unit_entityname").attr("value","crc17_propertyunit");
});

View solution in original post

Highlighted

Thank you so much, @hardikv  ( and @chleverenz ) !

 

I got it to work and it's amazing! 🙂

 

Cheers both of you!

Highlighted

@oml :

wow, you pages look great. great selection, great view to single entities, picture carousel, top - i like it

Highlighted

@chleverenz 

 

Well, thank you very much! It's my first try on Portals. 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (8,944)