Recipes
Data & Functions
Pass user input into a REST API

Pass user input into a REST API call

Problem

You have user input from a UI component that needs to be used in a REST API call.

Solution

  1. Add the UI component on your Page or Component (e.g. an Input named input)
  2. Create a new Page Function and select Make a REST API Request
  3. Enter the Path, Method, Headers, and Body for the request
  4. Use {{ input.value }} wherever you need the input’s current value
  5. Save and test your function

Discussion

See also