Skip to content
Branch: master
Find file History
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
assets/images 19r deprecations Sep 20, 2019
code VCAP-14030 Allow running capsule without default service, as long as … Dec 3, 2019
models Move files to user-data-persistence folder Sep 5, 2019
resources
screenshots VCAP-14030 Allow running capsule without default service, as long as … Dec 3, 2019
CHANGELOG.md
README.md VCAP-13927 wireframes Nov 18, 2019
airtable.md VCAP-14030 Allow running capsule without default service, as long as … Dec 3, 2019
capsule.bxb
restDB.md VCAP-14030 Allow running capsule without default service, as long as … Dec 3, 2019

README.md


Bixby User Data Persistence Sample Capsule

Overview

This is an example Capsule that demonstrates how to save data for each user. It allows user data to persist across conversations by performing CRUD operations on a remote database.

The scenario for this capsule is to allow each user to manage an "army". The user data is the army and consists of a single Boss Concept and any number of Minion Concepts.

Capsule Usage

READ

This will get the user data if it exists, otherwise there will be no results. nl("Summon my army")

Result View

READ Wireframe

CREATE/UPDATE

This will update the user data if it exists, otherwise it will create it. We demonstrate 2 types of persistence:

  • A property with a single state that gets replaced with any incoming value. nl("Crown Guru as the big boss")
  • A property with multiple values that get appended with any incoming value(s). nl("Enlist Kavin, Bobby and Stewart") followed by nl("Conscript Norberto") will result in an army of 4 minions.

CREATE/UPDATE Wireframe

DELETE

This will delete the user data. nl("Disband my army")

Setup Instructions

This sample capsule allows you to choose the service you would like to use to store your user data. Currently, the supported services are restDB and Airtable. Both of these offer a generous free tier and are easy to setup. We have test accounts already up and running that you can use to try them out live. Simply update the capsule.properties file capsule.config.mode to exampleRestDB or exampleAirtable respectively. Then try some of the capsule queries defined in the Capsule Usage section above.

Since this capsule is in the example namespace, it doesn't use dynamic Config & Secrets. To setup with a real namespace and keep your data secure:

That's it! Now you can sync your capsule and try out some queries!

Note: You may want to repeat the setup instructions twice to have a Dev and a Prod environment.

Limitations

This is intended for non-sensitive user data.


Additional Resources

Your Source for Everything Bixby

Guides & Best Practices

Video Guides

Need Support?

  • Have a feature request? Please suggest it in our Support Community to help us prioritize.
  • Have a technical question? Ask on Stack Overflow with tag “bixby”
You can’t perform that action at this time.