Visual Builder

Get Involved. Join the Conversation.

Topic

    Parashar Gupta
    Passing multiple parameters in "Navigate to URL"...Answered
    Topic posted July 24, 2018 by Parashar GuptaRed Ribbon: 250+ Points, last edited March 11, 2019 by Arijit ChakrabortyBronze Trophy: 5,000+ Points, tagged JET, REST, UI, Web 
    523 Views, 5 Comments
    Title:
    Passing multiple parameters in "Navigate to URL" action node
    Summary:
    Is it possible to dynamically pass multiple parameters while calling an external URL through "Navigate to URL"?
    Content:

    Hello All,

    I am new to VBCS and have some basic query regarding calling an external url passing in some parameters, on click of a button.

    I have a VBCS page where I am reading couple of record from a webservice endpoint and displaying them in a list view. Also, I have a route button in each record row of the list view, and when I click on any of these route buttons in any of these rows, it should take 2 attributes (say customer id and region), and call an external link with these two attributes being added as url parameter to render the page of that external application. 

    So if I have 2 rows in the list view like below

    List View

    1 Customer1    APAC   Construction  ROUTE_BUTTON
    _____________________________________________

    2 Customer2    EMEA   Hospitality     ROUTE_BUTTON
    ______________________________________________

    and clicking on the 1st row ROUTE_BUTTON should call an action chain that would have a "Navigate to URL" action node, which would call a url like:

    http://www.externallink.com/callWS?cust=Customer1&region=APAC

    and clicking the 2nd row ROUTE_BUTTON should call action chain that has the "Navigate to URL" with the URL parameters passed as below:

    http://www.externallink.com/callWS?cust=Customer2&region=EMEA

    So wanted to check if from a page, on click of a button, can I pass parameters dynamically from the page while calling the Navigate to URL? Would be grateful if someone can guide me as to how to pass this, or if I should follow some other approach to get this accomplished.

    Thanks & regards.

    Best Comment

    JT Thomas

    Yes, this is possible. The steps are:

    1) Obtain the values from the selected row and map the to a set of variables. See this video for an example.

    https://www.youtube.com/watch?v=msVY0uNXsAU

    2) Setup your Navigate to URL with query parameter definitions that match the names of your expected query parameters.

    3) Set the value portion of the JSON query parameter description to the variable in the app you wish to map. See screenshot for an example. 

     

    Comment

     

    • JT Thomas

      Yes, this is possible. The steps are:

      1) Obtain the values from the selected row and map the to a set of variables. See this video for an example.

      https://www.youtube.com/watch?v=msVY0uNXsAU

      2) Setup your Navigate to URL with query parameter definitions that match the names of your expected query parameters.

      3) Set the value portion of the JSON query parameter description to the variable in the app you wish to map. See screenshot for an example. 

       

      • JT Thomas

        See that they map to the URL: 

      • Parashar Gupta

        Thank so much for the pointers, Thomas. 

        If I have a multi-select list view/table, is there a way I can pass the user and email of multiple selected rows in some array as  a parameter while I call the url? I have a requirement that when the user selects multiple rows from the list and clicks on a dispatch button, the selected set of userid/email should be sent to that url for batch processing of data.

    • JT Thomas

      Hi Parashar,

       

      Sure you can do that. You would need to create a page variable that is type array and then build some looping logic (check out forEach in your Action Chain) to read each selected row in the table to add the data you want to the array, likely as a JSON object, within each array index for each row. Then when you make the service call you can pass it by mapping to your body for a POST call (I assume it is a POST call). 

      ~/jt

       

      • Parashar Gupta

        Thanks so much, Thomas, for the guidance. I am kind of new to VBCS, and would try it out as you specified to see if I can achieve this. Thanks again for your guidance.

        Regards,
        Parashar