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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,499)