HAP icon

HAP

Interact with HAP (Hyper Application Platform) API

Option Set → Create

AI-generated

Overview

This node interacts with the Hyper Application Platform (HAP) API to manage option sets. Specifically, the "Create" operation under the "Option Set" resource allows users to create a new option set by specifying its name and defining an array of options. This is useful in scenarios where you want to programmatically define sets of selectable options for forms, surveys, or any application feature that requires predefined choices.

Practical examples include:

  • Creating a custom dropdown list for a form with specific color-coded options.
  • Defining scoring criteria for survey answers by enabling scores on options.
  • Automating the setup of option sets during application deployment or configuration.

Properties

Name Meaning
Name The name of the option set to be created.
Options An 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 JSON input structured like this example:

[
  {
    "value": "Option 1",
    "index": 1,
    "color": "#C3F2F2",
    "score": 1
  }
]

Output

The node outputs JSON data representing the newly created option set as returned by the HAP API. This typically includes details such as the option set's unique identifier, name, options array, and any metadata related to colors and scores if enabled.

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

Dependencies

  • Requires an API key credential for authenticating with the HAP API.
  • The node sends requests with headers specifying JSON content type.
  • No additional external dependencies are indicated beyond the HAP API service.

Troubleshooting

  • Common issues:

    • Invalid JSON format in the Options property can cause request failures.
    • Missing required fields such as the option set Name or empty Options array will likely result in errors.
    • API authentication errors if the API key credential is missing or invalid.
  • Error messages:

    • Errors related to malformed JSON input should be resolved by validating the JSON structure before execution.
    • Authentication errors require checking the configured API key credential.
    • API response errors may indicate permission issues or invalid parameters; reviewing the HAP API documentation for correct usage is recommended.

Links and References

Discussion