web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to populate datave...
Power Pages
Unanswered

How to populate dataverse tables using HTML form

(0) ShareShare
ReportReport
Posted on by 20

Hi there, 

I have a custom HTML form on my portal app. This form is not connected to any table, it is simply, an HTML form that I created by editing the code. I need the data that was submitted to this form to be sent to two Dataverse tables and new records should be created in the tables respectively. How can I achieve this? 

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @PriyavartRajain 

     

    You can achieve this in a few ways. 

     

    1. Build a PCF component for your custom forms and use the portal web API to pass the data and create records. 

    The official reference here: 

     

    2. Build and host your Form on your Page and use power automate to create a record on the Form submit action. 

    https://www.alphabold.com/how-to-trigger-power-automate-flow-from-power-apps-portals/ 

     


    Hope it helps. 
    ------------

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

     

     

  • Pinosmil Profile Picture
    21 on at

    Hi @PriyavartRajain,

    The answer above is correct, but I recommend you consider if you can remove your custom HTML form and separate on two different steps using and Advance form (one for each one of the tables). This will simplify management and refactor in the future.  

  • GWham1 Profile Picture
    on at

    I would suggest an advanced form with a couple steps (for each table). But you really want to use custom HTML you could use the web API https://learn.microsoft.com/en-us/power-apps/maker/portals/write-update-delete-operations to create the records.

  • jai2420 Profile Picture
    2 on at

    Are you able to do that now for I need help 
    I want to create a custom view in a model driven app (using HTML and JS) that has fields like first name, last name , email and a submit button and when I press the submit button the entries should get updated in a dataverse table
    Can you help
    @PriyavartRajain 
    @GWham1 

     

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @jajaja ,

     

    You can do that by using the HTML, Liquid and JS. You can check the below article for more information

    Power Apps Portals – Going beyond with Portals using Web API – Oliver Rodrigues (oliverrodrigues365.com)

    Also you have to define the below function before starting using the Portal webapi, bu this point is not mentioned at the article so I preferred to highlight that

    (function(webapi, $){
    	function safeAjax(ajaxOptions) {
    		var deferredAjax = $.Deferred();
    		shell.getTokenDeferred().done(function (token) {
    			// add headers for AJAX
    			if (!ajaxOptions.headers) {
    				$.extend(ajaxOptions, {
    					headers: {
    						"__RequestVerificationToken": token
    					}
    				});
    			} else {
    				ajaxOptions.headers["__RequestVerificationToken"] = token;
    			}
    			$.ajax(ajaxOptions)
    				.done(function(data, textStatus, jqXHR) {
    					validateLoginSession(data, textStatus, jqXHR, deferredAjax.resolve);
    				}).fail(deferredAjax.reject); //AJAX
    		}).fail(function () {
    			deferredAjax.rejectWith(this, arguments); /*on token failure pass the token AJAX and args*/
    		});
    		return deferredAjax.promise();
    	}
    	webapi.safeAjax = safeAjax;
    })(window.webapi = window.webapi || {}, jQuery)
     

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.
    If you like my response, please give it a Thumbs Up. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 21 Super User 2026 Season 1

#2
CN-06091549-0 Profile Picture

CN-06091549-0 18

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 17 Most Valuable Professional

Last 30 days Overall leaderboard