Application Functions

On this page, we describe how to get an application form, edit form inputs manually, set application properties, display application input values for readibility, request AI to fill in applications, validate applications, and submit applications.

Initializing the Application Function

Initialization

  const {getForm} = wrangle.applicationFunctions;

Retrieving an Application Form

Form information is necessary to apply to a job through Wrangle. This function returns an Application object with a Job object input.

Parameters

  • Name
    job
    Type
    Job
    Description

    A job object to grab the form of. Find jobs using either returnJobsUS or returnJobsInternational.

Call

  const form = await getForm(job); // form is an Application object

Response

  Application {
    // application schema
  }

Edit an Input Value

Use this function to edit input values within the form. Use listInputs to view the inputs in a straightforward way.

  • Name
    label
    Type
    string
    Description

    Label of the field to change, exactly as it appears in the form (use listInputs to see this).

  • Name
    value
    Type
    string
    Description

    New value of this field. If this field has options, the new value must be exactly the same as a valid option.

Call

  // form is an Application object
  form.setUserInputs(label, value)

List Form Inputs

Use this function to display the form input information in an easy-to-read format.

  • Name
    label
    Type
    string
    Description

    Question from the form.

  • Name
    tag
    Type
    string
    Description

    Tag of the input (input, text, textArea, etc).

  • Name
    value
    Type
    string
    Description

    Current value of the field (provided by the user through editInput or through AI using setAI).

  • Name
    options
    Type
    array
    Description

    Array of valid answers to this question. If this field is null, there are no options for this question.

Call

  // form is an Application object
  console.log(form.listInputs());

Response

  [
    [label, tag, value, options],
    [label, tag, value, options],
    ...
  ]

Set AI

Use AI to complete the form. Keep in mind that some fields may not be correctly filled, so when using AI, the application object could still fail validation.

  • Name
    user
    Type
    User
    Description

    User object to send in the application for.

Call

  // form is an Application object
  // user is an User object
  await form.getAI(user);

Response

  [
    Application {
      // application schema
    },
    Application {
      //...
    }...
  ]

Apply

Once all inputs are correctly filled, this is the final step to submitting an application with Wrangle. This function will validate the inputs and throw an error if they are invalid, and apply to the job if they are valid.

  • Name
    user
    Type
    User
    Description

    User object to apply to the job for.

Call

  // form is an Application object
  // user is a User object
  await form.apply(user);

Was this page helpful?