Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Mohammed Alyahya
    Accessing addProperties variables in Flows - Android sdk
    Topic posted July 12, 2018 by Mohammed Alyahya, last edited November 13, 2018 by Arijit ChakrabortyBronze Trophy: 5,000+ Points, tagged Android, Bots 
    64 Views, 3 Comments
    Title:
    Accessing addProperties variables in Flows - Android sdk
    Summary:
    How to retrieve properties in the Flows chat bot console added through the android sdk
    Content:

    Hi,

    I embedded the Oracle chat bot using the sdk (bots-client-sdk-android-18.1.1.0) into one of our apps.

    The sdk is working fine, but I facing an issue with accessing the user properties set through the android sdk. I don't seem to be able to retrieve the property in the chat bot flow console. Can someone help me with how to do that.

    ----------------------------------------------------

    a little more details:

    I am setting the user's first name, last name and then adding two different string variables (someVariable1, someVariable2) to the user through the User.getCurrentUser().addProperties(); method in the sdk.

    Now I am able to retrieve the updated first and last name of user in the Flows page of my chat bot. However, I haven't been successful in retrieving the two properties at all. 

    I tried accessing them like a user scoped variables through "${user.someVariable1.value}" and a few other options but to no use

     

    I would appreciate the help in accessing those added properties.

    Regards,
    Mohammed Alyahya

    Comment

     

    • Marcelo Jabali

      Hi Mohammed,

      First of all, there is an updated client library available (18.2.3) if you are interested on that.

      To use custom properties in your dialog flow you would need to use a >= 18.2.3 Bot and then use the following:

      ${profile.someVariable1.value}

      and here is a sample System.Output component to display that info:

        outputCustomProfileVariables:
          component: "System.Output"
          properties:
            keepTurn: false
            text: "Custom variables: ${profile.someVariable1.value} and ${profile.someVariable2.value}"
          transitions:
            return: "done"

      -Marcelo

    • Mohammed Alyahya

      Hi Marcelo,

      I tried using the profile scope name in the older version and it didn't work. I will try to update to the newest sdk and give it another try.

      Thank you for your help.

      -Mohammed 

    • Marcelo Jabali

      Correct. Make sure you update both the SDK and the Bot (server side stack) to >= 18.2.3.