Rate map or topic - Fluid Topics - Latest

Fluid Topics Designer Guide

Category
Reference Guides
Audience
public
Version
Latest

The rate() JavaScript method makes it possible to rate a map or topic. It is only available in the Reader designer (with the map variable) and Topic template designer (with the topic variable).

It corresponds to the Rate a topic web service.

Example

The following example gives five stars to the currently open topic.

async function rateTopicAsync() {
    try {
        await topic.rate("STARS", 5);
        console.log("Topic has been rated with 5 stars!");
    } catch (error) {
        console.error("Error while rating the topic:", error);
    }
}

// Call the function to give five stars to the topic
rateTopicAsync();