This section consists of Database Things and fields description for every thing which is part of the template.

Introduction

To get to the Data section, click the database icon on the left side tabs in Bubble Editor.
Important: See Bubble manual information when working with data: https://manual.bubble.io/help-guides/working-with-data; https://manual.bubble.io/core-resources/data.

Data Types

Note: In case you have accidentally deleted a data type - no worries! Bubble lets you restore💪the deleted data type. Clicking on 'show deleted types' or 'show deleted fields' from the Data → Data types tab will reveal the deleted items, and a 'restore' button will appear next to each deleted entry. Simply click 'restore', to restore a field or data type.
💡
Tip: Aside from the below-listed data types and fields, Bubble creates these default fields visible in each data type: Creator, Modified Date, Created Date and Slug, except for the User data type. The User data type will have the following fields: email, Modified Date, Created Date and Slug. These fields' values can be used in workflows, conditional formatting, etc. To learn more, see the Bubble manual

Blog

This data type contains all the blog posts on the app.
Field Name
Type
Notes
blogContent
text
This field contains the text content of the post.
blogImage
image
This field contains an image of the post.
blogTitle
text
This is the title of the blog post.
blogViews
number
This is the amount of views the post has.

Category

This datatype contains the domain of activities for companies.
Field Name
Type
Notes
categoryIcon
image
The icon for this specified category.
categoryImage
image
The image for this specified category.
categoryName
text
The name for this category.

Company

This datatype contains details about each company.
Field Name
Type
Notes
companyAddress
text
The physical address of the company.
companyBlogs
List of Blogs
List of blog posts created by a specific company.
companyCategory
Category
The domain of activity of the company.
companyConversation
Conversation
The conversation of the company with the app owner.
companyDescription
text
Stores the company description.
companyDistributedPoints
number
The amount of bonus points that were redeemed by customers using QR codes generated by the staff of this specific company.
companyLogo
image
The company's logo.
companyMarketPoints
number
The amount of points that were spent by customers on the products of this company.
companyName
text
The name of the company.
companyPhone
text
The phone number of the company.
companyProducts
List of Products
The products that company offers for sale.
companyReviews
List of Reviews
The reviews that the company got from the customers.
companyZip
text
The Zip code of the company.

ContactMessage

This datatype contains the messages send by users to app owner.
Field Name
Type
Notes
contactMessageBody
text
The text content of the message.
contactMessageEmail
text
The email of the sender.
contactMessageTitle
text
The subject of the email.

Conversation

This datatype contains all the conversations between users.
Field Name
Type
Notes
conversationMesages
List of Messages
The list of messages that are related to this conversation.
conversationNewMesage
yes / no
Using this we can show the users of this conversation a visual notification if there is an unread message.

Coupon

This datatype contains all the active coupons. Those are created when scanning a QR code and when redeemed, they automatically deleted.
Field Name
Type
Notes
amount
number
The amount of bonus points the customer will receive when redeeming a coupon.
code
text
The code of the coupon.
staff
User
The staff that generated the QR code from which the coupon was created by scanning it.

Log

This data type contains information about different events that happen in the app.
Field Name
Type
Notes
logAction
text
Contains the text description of the event.
logType
text
Contains a text that represents the type of the event. Currently we are using these types: Purchases, Bonus, Bonus Card and Signup.

Message

This data type contains all the blog posts on the app.
Field Name
Type
Notes
messageBody
text
The text content of the message.

Product

This data type contains all the products that are for sale.
Field Name
Type
Notes
productDescription
text
Description of the product.
productImage
image
Image of the product.
productName
text
Name of the product.
productPrice
number
The price for the product.
productSales
number
The number of times this product was sold.

Purchased Product

This datatype contains all the purchased products. When a product is purchased we create a new object of this type that contains the details of the purchase as well as the product (of datatype Product) so we can access all the details about it.
Field Name
Type
Notes
purchasePrice
number
Amount of points spent on the purchase.
purchaseProduct
Product
The product that was purchased. Used to get access to the details of the product that is for sale.
purchaseProductCompany
Company
The company that owns the product.
purchaseReviewed
yes / no
Boolean field that tells if the customer left a review for the purchase of the product.
purchaseUser
User
The customer that bought the product. It is of type user.

Review

This data type contains all the customer reviews.
Field Name
Type
Notes
reviewContent
text
Content of the review.

Subscription

This data type contains all the details of the subscriptions that users have. It contains the active subscription as well as canceled ones.
Field Name
Type
Notes
subscriptionActive
yes / no
Boolean field that shows if the subscription is active or not. If the user still pays for the subscription then it's active, if he canceled it but the current end billing period is not exceeded then it's still active otherwise it's not active.
subscriptionCanceled
yes / no
Boolean field that shows if the subscription was canceled. Tho the subscription will be still active until the end billing period.
subscriptionID
text
The stripe ID of the subscription.
subscriptionNextBilling
date
The next billing period. It is of type date. When canceling a subscription bubble actually deletes the details form it including the date of the next billing period (bubble has inaccessible fields where it store details about a subscription). This is why we store this info so in case the subscription is cancelled we can know when the subscription is supposed to become inactive.
subscriptionPlanName
text
The name of the plan.

Testimonial

This datatypes contains the testimonials for the app.
Field Name
Type
Notes
testimonialAuthor
text
Name of the person of this testimonial.
testimonialAuthorCompany
text
Name of the company of this testimonial.
testimonialAuthorImage
image
The profile image of this testimonial.
testimonialContent
text
The text content of this testimonial.
testimonialRating
number
The rating for this testimonial (up to 5).

Transactions

This datatype contains the details about all the bonus points transactions between customers and staff.
Field Name
Type
Notes
customer
User
The user this transaction is attached to.
points
number
The amount of bonus points that were spent on this transaction.
staff
User
The staff user that generated the QR code for the customer.

User

Bubble applications have a built-in User data type that acts like any type that is created in a database. For instance, you can modify a user, delete a user, list them in a repeating group, etc.
This data type stores the users' bio data (name, photo, gender, city, etc.) and profile information like comments made and chats or discussions associated with the user.
Field Name
Type
Notes
transactionNotification
yes / no
Stores the status of transaction notification.
userCompany
Company
The company that is attached to the user. The data type for it is Company.
userConversation
List of Conversations
The conversations that the user has with other users. The datatype for it is Conversation and it is a list.
userFirstName
text
The user's first name.
userLastName
text
The user's last name.
userPoints
number
The amount of bonus points the user has. These points are obtained by redeeming QR codes.
userProfilePhoto
image
Profile picture of the user.
userPurchasedProducts
List of Purchased Products
The products that the user bought. The data type for it is Purchased Product and it is a list. It is used to see the user's purchase history.
userSubscription
Subscription
The subscription the user subscribed to. The data type for it is Subscription.
userTransactions
List of Transactionses
The transactions of points that were redeemed by the user. The data type for it is Transaction and it is a list. It represents the QR codes that where scanned and redeemed.
userType
User Type
The type of the user. It is of the data type User Type. Based on this field we can check if the user is a client, staff, company or admin.
userWishlist
List of Products
Contains the products that where added to be bought later. It is of the data type Product and it is a list.
Note: The data type has a privacy rule applied. See the 💬 in the database under the privacy section for details.

User Type

This datatype is used for creating user roles.
Field Name
Type
Notes
userTypeID
number
A number used to identify this User Type. It can be used when doing a search.
userTypeName
text
The name of this User Type.

UserTotalPoints

This datatype contains all the points spent by a specific customer on products of a specific company.
Field Name
Type
Notes
company
Company
The company where customer spent bonus points.
customer
User
The customer that spent bonus points.
totalPoints
number
The amount of bonus points that a customer spent on products from a specified company.

Variable

This datatype contains constants that are used for some calculations or to speed up the syste
Field Name
Type
Notes
bonusAmount
number
The percent amount that is taken from each purchase and offered as bonus points to the customer trough a QR code.
WriteRights
yes / no
The ability to create, delete and modify things in admin panel. Set it to yes to have full access as admin.

Various Images

This data type stores the images displayed on index-customers page
Field Name
Type
Notes
customerImage
image
Stores the images to be displayed on the index-customers page.

Embedded Notes in Bubble Editor

This template comes with explicit Notes for Database fields, Option sets and their fields, and Privacy rules, which will guide you through the modification process.
In order to preview a Note of any data type or field, click on the 💬 icon.
Image without caption