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
Super User
Super User

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
Super User
Super User

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!

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,584)