• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

URL Parameter Filtering not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • URL Parameter Filtering not working

    Hello Team, I have troubleshot this so much I’m running out of ideas.
    I am trying to filter my app with URL parms. So many different ways I have tried and none of them work.
    I tried the URL filtering option in behaviors and I can’t get that working. I can get my URL working with the App ID and username and password for auto log in. But that’s it.
    For example. Here is my URL
    http://MyCompany.com?app=1125&TESTVIN=3C6JR7AG7GG338653

    This is a simple app with only 1 grid widget. I have a different app that’s more complicated but I decided to build this for POC purposes.
    Here is the configuration.

    URL APP config.pngThe field that contains these vehicles' VINs is in DMVVIN and I mapped it to TESTVIN. This URL won’t do it.

    So I went down the path of setting app vars with the URL, that didn’t work. I was checking the values with my startup program and it was not getting the app vars. It's almost the same test. The URL has TESTVIN=3C6JR7AG7GG338653 and TESTVIN is what I named the VAR and the URL parm. I still can’t get this app to filter with anything from the URL.

    If I create an APP Var and set the default values to 3C6JR7AG7GG338653 and then in the startup behavior, filter widget with this app var, it works.

    What am I missing on URL parms?

    Valence Framework 6.0.20211007.0



  • #2
    If you want to launch the app within the portal you need to pass the application params in a param named "appParams". The parameter needs to be a JSON encoded string so that way you can pass multiple params to the application;

    To determine the value of the encoded string you could either open the browser's developer tools and run the below example in the console or run it in PlayCode.

    Code:
    var appParams = {
            TESTVIN : '3C6JR7AG7GG338653'
        },
        paramsEncoded = encodeURI(JSON.stringify(appParams));
    
    console.log('appParams value: ', paramsEncoded);
    The above example will give you "appParams value: %7B%22TESTVIN%22:%223C6JR7AG7GG338653%22%7D" in the console.

    With that value, your URL should be
    Code:
    http://MyCompany.com?app=1125&appParams=%7B%22TESTVIN%22:%223C6JR7AG7GG338653%22%7D
    If you want to launch the app and don't need it to be running within the portal you can use the direct URL and just pass your parameters as normal since it's not running within the portal.

    Example Direct URL:
    http://MyCompany.com/build/productio...JR7AG7GG338653

    Comment


    • #3
      Hello Jonny, I am trying to launch the app from a URL that I will be sending a whole bunch of people. This app is replacing a PDF that we used to send out to a large group of people to get information about their company vehicle. A big percentage of those folks do not have IBM accounts so the plan was to send a URL with a generic user account and password and the app id. but I still need to know who is logging in, so the plan was to send a URL parm with a username app var. But first I wanted to make sure the app filters to only that person's vehicles, and to simplify it even more, I chose to try and send the VIN to make sure I could accomplish this. I have been referencing https://valence6.helpdocsonline.com/...eter-filtering and that site makes it seem really easy.
      I'm not trying to launch the app inside the portal, I'm trying to launch the app with a URL, no portal access(which I can get that working), username and password, app id, environment id, and finally app vars and widget filtering. I can get everything working except the app vars and widget filtering.

      And I just tested your link and it worked. So it's the combination of URI encoding and adding the appParms keyword to the URL.
      This URL worked as expected on the first test.

      http://MyCompany.com?app=1125&appPar...%22TESTVIN%22: %223C6JR7AG7GG338653%22%7D
      Last edited by llarge; 10-19-2021, 11:43 AM.

      Comment


      • #4
        If you click on the share option on the application within NAB it will bring up an email with a tinyurl. If you use that tinyurl you'll see the true direct URL.


        NAB Share.png

        Comment


        • #5
          So I'm not sure what's wrong with our Share option. When I click it, a new Outlook email pops up with &body= as the subject, and that's it.

          Comment


          • #6
            Not sure, its just doing a simple mailto via the browser

            Comment

            Working...
            X