Dataset Switching using vb.net
Does any one have experience with dataset switching using vb.Net to switch datasets on the fly? We are having issues getting the json string generated. Any help would be greatly appreciated!
Answers
-
'switch datasets' ... what do you mean?
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
using datasetRedirects at run time. Basically changing the dataset for all cards on a dashboard on a webpage. Lets say you have a database with 2 tables in it - both have the same exact structure. Instead of combining the data from both tables into 1 table and using programmatic filtering you can swap out the datasets for a dashboard at runtime by using datasetRedirects. We cannot get this to work in .net
0 -
i assume this is what you're talking about.
are you able to get the desired outcome using other embed methods? what code are you writing that does not work?
(caveat, i don't know much about vb.net, but "it's not working" is a bit hard to troubleshoot :P )
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
We are an angular shop. So we can only use .Net
Dim embedTokenRequest As New HttpRequestMessage() With {
.RequestUri = New Uri(embedAuthUrl),
.Method = HttpMethod.Post,
.Content = New StringContent(JsonConvert.SerializeObject(New With {
Key .sessionLength = 1440,
.authorizations = {
New With {Key .token = embedId,
.permissions = {"READ", "FILTER", "EXPORT"},
.datasetRedirects = {"v1:v2"}
.filters = {New With {Key .column = "ENTRY_YEAR", .operator = "GREATER_THAN", .values = {"2020"}}},
.policies = Nothing}
}
}))
}
The resulting JSON string is supposed to be formatted like Domo's example: on https://developer.domo.com/docs/embed/dataset-switching. However we cannot get the resulting json string to be "dataSetFrom":"dataSetTo"
visualization1: {
clientId: process.env.CLIENT_ID, clientSecret: process.env.CLIENT_SECRET, embedId: process.env.EMBED_ID1,
datasetRedirects: {
"a19d0ef1-ca31-4bfd-b168-018b93109671":"a19d0ef1-ca31-4bfd-b168-018b93109672",
"a19d0ef1-ca31-4bfd-b168-018b93109673":"a19d0ef1-ca31-4bfd-b168-018b93109674"
},
filter: {"@type":"IN","leftExpression":{"@type":"COLUMN","columnName":"color"},"rightItemsList":{"@type":"EXPRESSION_LIST","expressions":[{"@type":"STRING_VALUE","value":"red"}]}}
},
}
0 -
.datasetRedirects = {"v1:v2"}
this looks problematic (compared to the rest of the code you're writing.
shouldn't it be
.datasetRedirects = { .v1 = v2"}
or something similar.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0 -
V1 and V2 are just variables. Ultimately the resulting json needs to be formatted like:
"a19d0ef1-ca31-4bfd-b168-018b93109671":"a19d0ef1-ca31-4bfd-b168-018b93109672"
0 -
i understand. i'm questioning whether the code you've written would actually return that result. what json ARE you getting?
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 731 Beast Mode
- 55 App Studio
- 40 Variables
- 683 Automate
- 175 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 122 Manage
- 119 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 107 Community Announcements
- 4.8K Archive