How to use templated links in Apache Superset - jinja2

In the time series table chart of Apache Superset, there is an option to create a "templated link" using the url field where it appears you can make the metric being displayed, for example, a link to another website or dashboard.
I have not found any documentation on how this is done and I am struggling to understand how this can be done. my ultimate goal is to allow a user to click on the metric of interest which will redirect to another pre-filtered dashboard.

I'm not sure if you can do what you want. Currently the URL field has access to the metric object of each row, which has the following attributes (this is an example for a simple COUNT(*) metric):
{
certification_details: null,​
certified_by: null,
d3format: null,
​ description: null,
​​ expression: "COUNT(*)",
id: 24,
​ is_certified: false,
​​ metric_name: "count",
​​ verbose_name: "COUNT(*)",
​​ warning_text: null,
}
​
So if you set URL to https://example.com/{{ metric.metric_name }} the metric name in the table will be a link pointing to https://example.com/count in this example (see the link at the bottom left of the screenshot):

Related

Zabbix Trigger for text change

I am trying to create a trigger for changes in JSON file that I get from endpoint.
I've already created item that excludes web page header and only leaves json file contents as plain text.
{"state": true
"riskName":"example"
"errorMessage":null}
{"state": false
"riskName":"example"
"errorMessage":"errorMessage-example"}
I was wondering if it's possible in zabbix to trigger event based on state change true -> false and show the errorMessage that's connected to {"state":false} event
Please correct me if I'm going in wrong direction
Create dependent item, use Preprocessing JSONPath $.state - so you will have only short value "true" or "false".
Then create trigger with condition last(item)="true".

Insights-Widget "When" Condition Value Options

I am trying to add a "When" condition to a custom insights widget so that the widget is only visible on a dashboard for a specific database.
The problem is that the documentation for this doesn't cover the possible conditions and values available:
https://learn.microsoft.com/en-us/sql/azure-data-studio/tutorial-build-custom-insight-sql-server?view=sql-server-ver15
The top part of the JSON code I have so far for this widget it is:
{
"name": "Import Queue",
"when": "database=MyDB1",
"gridItemConfig": {
"sizex": 2,
"sizey": 2
},
But the condition "database=MyDB1" or "database==MyDB1" isn't working. I suspect that's because I have set the value for this condition wrongly, but can't find an example of how to use this condition.
Can anyone suggest what I need to place for the "when" condition to only show for the specific database MyDB1?
Update Oct 2021
I have since discovered on the Azure Data Studio GitHub wiki (https://github.com/microsoft/azuredatastudio/wiki/Contribution-points) that the format requires the parameter to be in single quotes. An example contained in this wiki is as follows:
"when": "connectionProvider == 'MSSQL' && !mssql:iscloud"
Applying this to my problem, I changed it to:
"when": "database == 'MyDB1'"
But this still didn't work. I suspect that database isn't the correct parameter name, so will keep searching. the official Microsoft documentation still hasn't been updated as yet.
Further Update
There is now finally a solution for this, which I have placed in the answers below (https://stackoverflow.com/a/69632460/7858451).
After much digging around on Azure Data Studio GitHub repository, I finally came across this wiki: https://github.com/microsoft/azuredatastudio/wiki/Context-Variables
This says for context variables:
databaseName - A string of the database name of the current
connection. Ex. databaseName == 'master'
So it was databaseName that I was after all this time, plus the parameter value needed to be in single quotes.
Which means, by changing the configuration file JSON to the following:
{
"name": "Import Queue",
"when": "databaseName == 'MyDB1'",
"gridItemConfig": {
"sizex": 2,
"sizey": 2
},
It finally hides the dashboard for all databases than the one specified.

Does Gsuite support the creation of custom fields that can be used to discover information when used as search strings?

I want to bulk-load some emails in the Gsuite account using a csv file. However there's this field called "building id" which is NOT REQUIRED but is handy for my requirements; I just realized that out of the box, Gsuite cannot locate a record by the mentioned field as the search term. My question is, is there a workaround to this problem? Better yet, does Gsuite support the creation of custom fields that can be used to discover information when used as search strings? Anyone who knows a solution to this problem?
When using the Directory API to list the members, using the query parameter to get the members with a specific buildingId is not an option. The available queries that can be made are listed here.
However, you can create your own custom field using the below Directory API schemas.insert request:
POST https://admin.googleapis.com/admin/directory/v1/customer/{customerId}/schemas
With the following request body:
{
"schemaId": string,
"schemaName": string,
"fields": [
{
"displayName": "",
"fieldName": "",
"fieldType": ""
}
],
"displayName": string,
}
Afterwards, when you want to retrieve the users with a particular value, you will have to make the below request:
GET https://admin.googleapis.com/admin/directory/v1/users
With the following fields:
customFieldMask > set to the name of the schema;
projection > set to custom;
query=schemaName.FIELD='VALUE' > this will query the users who have the field from the custom field with the value 'VALUE'.
Reference
Directory API Users:list;
Directory API Schemas.insert.

How to filter data using angular 4 route params

Can anybody please explain how I can use Angular (4) route params to filter a JSON object to only return 1 record (so I only want to show more specific details, bit like an admin panel). All the examples I've seen just seem to show you how to console.log the param id from the url and don't really go much further (or if they do it isn't explained as clearly as I would like).
What I want to do is I have a JSON object say
{id: 1, name:"Dave"}, {id:2, name: "Steve"}
How can I use the route param in a service to show only the name based upon the id I pass in the url?
name/1
So this example would give me access to the first set of records.
Thanks

How can I prevent to set a required recipient and the Open Graph object to appear?

I am currently trying to embed a Yammer Open Graph feed into SharePoint pages. I am using the following configuration:
yam.connect.embedFeed({
container: "#embedded-feed"
, feedType: "open-graph"
, feedId: ""
, config: {
defaultGroupId: 27862 // recipient is required so I specified a dedicated group for article feeds
//, use _ sso: true
, header: false
, footer: false
, showOpenGraphPreview: false
, defaultToCanonical: false
, hideNetworkName: true
, promptText: "What do you think of this article?"
}
, objectProperties: {
url: "" // <empty> takes the url from the current page
, type: "page"
}
});
(feed configuration can be generated through https://www.yammer.com/widget/configure)
It seems that a recipient is required, so I had to create a dummy group and specify this dummy group-id where all the messages are landing. I don't want to polute some regular group with Open Graph object feeds. Can this be addressed in a better way?
Additionally, at least the first message contains the Open Graph object attached to it. This doesn't look nice, and is quite unnecessary as the feed is completely embedded onto the object already. Can this attachment be prevented? Moreover, as soon as you specify a calculated object url into the objectProperties, the object is attached to all messages. Which is completely overdone. Ideally the Open Graph object url is only used to identify the specific object feed.
Refer to the Facebook api where these two requirements are met: https://developers.facebook.com/docs/plugins/comments
I think I have captured your questions below. Added my answer
How can I prevent to set a required recipient?
You don't need to specify defaultGroupId. Adding this value simply changes the default Yammer group that the Embed Feed lists.
From the documentation:
'You can set a default group for comments in an OGO Object Feed that will appear in the destination box of the publisher by specifying a defaultGroupId. The user can change this and post to a group of their choice.
If you do not specify a defaultGroupId, the destination box will be left blank and the user will be prompted to add a group on their own when posting a comment.
Specifying defaultGroupId: 0 will set the default to All Company.'
https://developer.yammer.com/docs/commenting
How can I prevent the Open Graph object to appear in the posting message window?
I am pretty sure this is by design. I can see how this can be confusing. I don't think there is a way to disable that.