Hello Helical Insight Team,
I am using Helical Insight version 5.2.2. What I would like to do is to get the profile value by SSO token and set that as a default value of the filter.
Thank You,
Netta.
Hello Helical Insight Team,
I am using Helical Insight version 5.2.2. What I would like to do is to get the profile value by SSO token and set that as a default value of the filter.
Thank You,
Netta.
Hello Netta,
In this document, we will cover how to set user profile values as default dashboard variables dynamically
Create a report with a filter and add the same filter at the dashboard level (a filter that can be used to filter the report data using profile values)
Right-click on an empty space in the dashboard designer, then go to Advanced > JS
Code :
var profilesData = {{ user | json }};
if (profilesData.profile.some(p => p.profileName === "client_name")) {
var client_name = profilesData.profile.find(p => p.profileName === "client_name").profileValue;
if (typeof client_name === "string" && client_name.includes(",")) {
client_name = client_name.split(",").map(item => item.trim()); // Convert comma-separated string to array
} else if (!Array.isArray(client_name)) {
client_name = [client_name]; // Convert single value to array
}
setVariable('client_name', client_name);
}
Note1 : The above JS code handles one profile name, “client_name.” If you want to add more, you need to include additional if conditions. You must use the exact profile key name.
Note2 : We have created a profile with the name “client_name”, which contains multiple values.
In the above snapshot we have passed the profile value via the user role management page. But the same can come directly via SSO token as well.
Thanks You,
Helical Insight Team.