HAP icon

HAP

Interact with HAP (Hyper Application Platform) API

Overview

This node interacts with the Hyper Application Platform (HAP) API to create a new Option Set. An Option Set is a collection of selectable options that can be used in various parts of an application, such as dropdown menus or selection fields. This node is useful when you want to programmatically define or update sets of options for use in your HAP-based applications.

Typical scenarios include:

  • Automating the creation of option sets during application setup.
  • Dynamically generating option sets based on external data sources.
  • Managing option sets as part of a larger workflow automation.

For example, you might create an option set named "Priority Levels" with options like "High", "Medium", and "Low", each optionally having associated colors and scores.

Properties

Name Meaning
Name The name of the option set to create.
Options A JSON array of option objects defining each option's value, index, color, and score.
Enable Color Boolean flag indicating whether colors are enabled for the options.
Enable Score Boolean flag indicating whether scores are enabled for the options.

The Options property expects a JSON array with objects structured like:

[
  {
    "value": "Option 1",
    "index": 1,
    "color": "#C3F2F2",
    "score": 1
  }
]
  • value: The display text or identifier for the option.
  • index: The order or position of the option.
  • color: Hex color code associated with the option (if colors are enabled).
  • score: Numeric score associated with the option (if scores are enabled).

Output

The node outputs JSON data representing the created option set as returned by the HAP API. This typically includes details such as the option set ID, name, list of options, and any metadata related to colors and scores if enabled.

If the node supports binary data output, it would represent any file or media content related to the option set, but based on the provided code and properties, this node primarily deals with JSON data.

Dependencies

  • Requires an active connection to the HAP API via an API key credential configured in n8n.
  • The node sends requests with JSON payloads and expects JSON responses.
  • Proper permissions on the HAP platform to create option sets are necessary.

Troubleshooting

  • Invalid JSON in Options: If the JSON array in the Options property is malformed, the node will fail. Ensure the JSON syntax is correct.
  • Missing Required Fields: The "Name" and "Options" properties are required. Omitting them will cause errors.
  • API Authentication Errors: If the API key credential is missing or invalid, authentication errors will occur.
  • Permission Denied: Insufficient permissions on the HAP platform to create option sets will result in authorization errors.
  • Color/Score Flags Mismatch: Enabling colors or scores without providing corresponding values in options may lead to inconsistent data or warnings.

To resolve these issues:

  • Validate JSON input carefully.
  • Confirm API credentials and permissions.
  • Provide consistent option data matching enabled features.

Links and References

Discussion