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

Populate fields in form

Hi everyone,

 

I need with following:

 

I need to create URL which can directly open a form in portal with two parameters (i.e. Name, Email)

 

Next, I need to populate URL parameters values in my form which can also be stored at the backend.

 

For Example:

 

Name //populated from URL

Email  //populated from URL

other info

 

 

Any help would be appreciated

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
hardikv
Solution Sage
Solution Sage

Hi @Jackson_Dhorty 

 

  • Go to Your Basic Form
  • Click on Additional Settings
  • Add below code in Custom JavaScript

URL: https://xyz.powerappsportals.com/appointment/?subject=yoursubjecttext&description=yourdescriptiontex...

 

 

$( document ).ready(function() {
    var URLs = new URLSearchParams(window.location.search);
    $("#subject").val(URLs.get('subject'));
    $("#description").val(URLs.get('description'));
});

 

 

Using above code, you can only populate value in fields.

 

However, If you want to first create record with this parameters, you have to use WEB API to create record then you can redirect to this record. Please refer below MS doc to create record using web api.

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations

 

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

 

View solution in original post

1 REPLY 1
hardikv
Solution Sage
Solution Sage

Hi @Jackson_Dhorty 

 

  • Go to Your Basic Form
  • Click on Additional Settings
  • Add below code in Custom JavaScript

URL: https://xyz.powerappsportals.com/appointment/?subject=yoursubjecttext&description=yourdescriptiontex...

 

 

$( document ).ready(function() {
    var URLs = new URLSearchParams(window.location.search);
    $("#subject").val(URLs.get('subject'));
    $("#description").val(URLs.get('description'));
});

 

 

Using above code, you can only populate value in fields.

 

However, If you want to first create record with this parameters, you have to use WEB API to create record then you can redirect to this record. Please refer below MS doc to create record using web api.

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-overview

https://docs.microsoft.com/en-us/powerapps/maker/portals/web-api-perform-operations

 

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

 

View solution in original post

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,849)