Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Sunil Kumar
    How to add dynamic values to Instant Apps Chart of...Answered
    Topic posted July 4, 2018 by Sunil KumarRed Ribbon: 250+ Points, last edited July 31, 2018 by Arijit ChakrabortyBronze Trophy: 5,000+ Points, tagged Bots, Mobile, Tip 
    110 Views, 5 Comments
    Title:
    How to add dynamic values to Instant Apps Chart of Intelligent Bot
    Summary:
    How to add dynamic values in instant app chart
    Content:

    I am trying to create an instant app which will display chart (chart should change by giving different inputs from bot).

    I am able to create chart with static values but  I want to add dynamic values using either parameters (inputs coming from bot) / Javascript snippets but not sure how to achieve this

    Please can some one help me with the code, documentation link  , any info etc

     

    Thanks in advance

    Sunil

    Best Comment

    Frank Nimphius

    Hi,

    instant Apps doesn't do this for you. An option would be to use a SOAP connector in Oracle Mobile to access your XML service. This then transforms the payload into JSON which then you can save to a bot context variable using a custom component. This variable then can be referenced as an input to Instant Apps. This is how I would try doing it. 

    Frank

    Comment

     

    • Frank Nimphius

      Hi,

       

      have a look here

      https://docs.chatbox.com/cb2/instant-apps/elements/chart-element/

       

      Frank

      • Sunil Kumar

        Thanks @Frank for the response. This documentation is very helpful.

        Now as per documentation i am trying to display chart based on external Web Api call. But the example shown in documentation assumes the Web Api will return JSON data. However Web Api i need to call returns XML data . How in Instant App i can convert/parse xml to json ??

         

    • Frank Nimphius

      Hi,

      instant Apps doesn't do this for you. An option would be to use a SOAP connector in Oracle Mobile to access your XML service. This then transforms the payload into JSON which then you can save to a bot context variable using a custom component. This variable then can be referenced as an input to Instant Apps. This is how I would try doing it. 

      Frank

      • Sunil Kumar

        Thank you @Frank once again for your response , I will follow the  approach you suggested . Just wanted to check can this be directly done in instant app to call xml based api.  As you said Instant App doesn't do this. So best way is through connector.

        Sunil

        • Frank Nimphius

          Well you could, but this may be more complicated than accessing the connector from a custom component and then passing the data to the Instant App upon launch. Here are some documents that may be helpful

          Explains how to pass data:

          https://blogs.oracle.com/mobile/techexchange%3a-how-to-populate-radio-groups%2c-checkboxes-and-lists-in-instant-apps-with-data-collected-in-oracle-intelligent-bots

          Explains how to set a value from a custom component to a variable

          https://blogs.oracle.com/mobile/how-to-populate-a-common-response-component-iterator-from-a-custom-component

          Explains how to access a connector

          https://blogs.oracle.com/mobile/techexchange%3a-master-oracle-intelligent-bots-backend-integration-with-oracle-mobile-cloud-enterprise-like-a-pro

           

          Frank