How can I post data from custom html form (before login form) into a form in a process.

Confluence User - 02 Jul, 2025

I'm trying to make an independent signup page in my app.

 // SIGN UP AJAX
  $('#signup-button').on('click', function () {
  const variables = {
    full_name: $('#reg-full_name').val(),
    username: $('#reg-username').val(),
    email_address: $('#reg-email').val(),
    password: $('#reg-password').val(),
    confirm_password: $('#reg-confirm_password').val(),
    phone_number: $('#reg-phone_number').val(),
    role: $('input[name="reg-role"]:checked').val(),
    Approval: $('#reg-approval').val(),
    status: 'Pending'
  };

  const formattedVariables = Object.entries(variables).map(([key, value]) => ({
    name: key,
    value: value
  }));

  const processDefId = 'it_helpdesk_ticketing%2333%23user_sign_up'; // Update if version changes

  $.ajax({
    url: `https://joanneeee.on.joget.cloud/jw/web/json/workflow/process/start/${processDefId}`,
    method: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({ variables: formattedVariables }),
    success: function () {
      alert('Registration submitted! Please wait for approval.');
      $('#signup-box').hide();
      $('#login-box').show();
    },
    error: function (xhr) {
      console.error("Signup failed:", xhr.responseText);
      alert('Signup failed: ' + xhr.responseText);
    }
  });
});

This is the code I used in before login form for the sign up part, but i can't get data from the ajax post request into my process. 

forms;json;ajax;userviews

1


03 Jul, 2025
confluenceUser
confluenceUser

Hello Joanne, 

I tried and it works on my end. Try checking these few points:

  • Check the Process Start White List user role permission. When you are sending the API to start the process, you need to have the appropriate role. 


The screenshot below shows that my process has been started under the roleAnonymous after registering in the login page.


I hope this clarifies your issue. Thanks!

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print