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!

Tagged:

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"
  • 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


  • 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"
  • 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"}]}}

    },

    }

  • .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"
  • 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"

  • 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"