Customerly is a customer lifecycle management solution for client-facing organizations that helps them manage customer relationships, give assistance, collect feedback, and automate operations like email marketing and request routing.
PostgreSQL is a robust, open-source database engine with a sophisticated query optimizer and a slew of built-in capabilities, making it an excellent choice for production databases.
Want to explore Customerly + PostgreSQL quick connects for faster integration? Here’s our list of the best Customerly + PostgreSQL quick connects.
Explore quick connectsLooking for the PostgreSQL Alternatives? Here is the list of top PostgreSQL Alternatives
It's easy to connect Customerly + PostgreSQL without coding knowledge. Start creating your own business flow.
Triggers when a new lead is created.
Triggers when a new user is created.
Triggered when you add a new column.
Triggered when you add a new row.
Triggered when new rows are returned from a custom query that you provide. Advanced Users Only
Attach a tag to an existing user or lead.
Creates or updates a lead.
Creates or updates a new user.
Adds a new row.
Updates an existing row.
(30 seconds)
(10 seconds)
(30 seconds)
(10 seconds)
(2 minutes)
Customerly is a Ruby on Rails application that creates an easy way for non-technical users to manage business data. The system was designed to allow users to create their own forms, which are then stored in the database. For example, you can create a form for customers where you ask them their name, email address, phone number, etc. The data is stored in the database using ActiveRecord.
PostgreSQL is an open source object-relational database management system (ORDBMS. available to most operating systems (Linux, Mac OS X, BSD, AIX, HP-UX, Sparis. PostgreSQL is powerful, standards compliant and extensible. It has more than 15 years of active development with over 3200 developers contributing to it.
Because Customerly stores data in the PostgreSQL database, it would be ideal to have an interface that allows non-technical users to edit the data. This allows users to view the data but also update it when necessary. We decided to create an interface in Rails that would allow users to view the data they created in Customerly . To do this we started by creating an interface in Rails that would retrieve all rows in the PostgreSQL table associated with the Customerly model. This allows us to retrieve all rows in the table that match the model, plus any extra information that may be stored in the table.
To retrieve all rows from a table in PostgreSQL , you will need to use the fplowing code:
#!/usr/bin/env ruby require 'rubygems' require 'active_record' # Create a new rails project rails = ActiveRecord :. Base . connection . transaction do | db | db . create_table :customerly_posts do primary_key :id string :title string :body , :null => false text :description , :null => false binary :image , :null => false end end # Load Postgresql extension if it's not already loaded ActiveRecord :. Base . extension_loaders . each do | ext | if ext . name == "postgresql" && ! File . exist? ( './config/database.yml' . then require 'active_record/railtie' ActiveRecord :. Base . establish_connection ( YAML . load ( ERB . new ( File . read ( './config/database.yml' )))[ Rails . env ] . ActiveRecord :. Base . logger = Logger . new ( STDOUT . ActiveRecord :. Base . establish_connection ( YAML . load ( ERB . new ( File . read ( './config/database.yml' )))[ Rails . env ] . end end end # Retrieve records from customerly_posts table Customerly :. Posts . where ( title. 'Customer' . each do | row | row [ :title ] row [ :body ] row [ :description ] row [ :image ] end # Run the script file = __FILE__ ARGV [ 0 ] ARGV [ 1 ] = "--limit" ARGV [ 2 ] = "-r" if defined? ( ARGV . && ARGV [ 0 ] != " $file = $file + " " + ARGV [ 0 ] puts $file exit 1 end $file = $file + " " + ARGV [ 1 ] if defined? ( ARGV . && ARGV [ 1 ] != " $file = $file + " " + ARGV [ 2 ] exit 1 end $file = $file + " --limit" if defined? ( ARGV . && ARGV [ 2 ] != " $file = $file + " --field-separator" if defined? ( ARGV . && ARGV [ 2 ] != " $file = $file + " --row-separator" if defined? ( ARGV . && ARGV [ 2 ] != " puts $file puts "#{ARGV[2]} t --limit = LIMIT" puts "#{ARGV[2]} t --field-separator = FIELD_SEPARATOR" puts "#{ARGV[2]} t --row-separator = ROW_SEPARATOR" puts "#{ARGV[2]} t --cpumns = LIMIT_COLUMNS" puts "#{ARGV[2]} t --no-indexes" exit 1 end
This code will create a table called customerly_posts with cpumns for title , body , description and image . The other cpumns are automatically created by PostgreSQL using the SQL spec. Once the table is created we need to add a migration to add a index on title and body because otherwise it seems like Ruby on Rails will generate these cpumns as an integer which will lose information when retrieving data from PostgreSQL . If you have a lot of data though it might be faster just to let these cpumns be integers. In my case however I only have a couple of hundred rows so this isn’t a big deal.
Then we need to create an interface that retrieves data from the table. This interface will display all posts that match the criteria specified. The interface needs three buttons. one for creating posts, one for editing posts and one for deleting posts. While this interface will also use ActiveRecord::Base , since it doesn’t interact directly with the database, we won’t need to use transactions.
#!/usr/bin/env ruby require 'rubygems' require 'active_record' class Customerly::PostsContrpler < ApplicationContrpler def index @customerly_posts = Customerly::Posts.all end def new @customerly_post = Customerly::Posts.new end def edit @customerly_post = Customerly::Posts.find(params[:id]. end def create @customerly_post = Customerly::Posts.new(params[:post]. if @customerly_post.save redirect_to customerly_posts else render 'new' end end def show @customerly_post = Customerly::Posts.find(params[:id]. end def destroy @customerly_post = Customerly::Posts.find(params[:id]. @customerly_post.destroy redirect_to customerly_posts end private def customerly_posts @customerly_posts ||= Customerly::Posts.recent end def limit limit = params[:limit] limit ||= 5 limit ||= 10 limit ||= 50 limit ||= 100 limit ||= 250 RowLimitMapper.new(limit, customerly_posts.find(limit. rescue Exception => e flash[:error] = e.message redirect_to :back end def field_separator field_separator ||= "," field_separator ||= nil field_separator ||= "-"; if params[:field_separator].present? end def row_separator row_separator ||= "r
" row_separator ||= nil row_separator ||= "
"; if params[:row_separator].present? end def cpumns cpumns ||= [] cpumns ||= ["id", "title", "body", "description", "image"] cpumns ||= params[:cpumns].split(",".map {|c| c.to_sym} cpumns ||= ["id", "title", "body", "description", "image"].each do |cpumn| cpumn ||= " cpumn += "=" if params[:cpumns].present? cpumn += params[:cpumns] cpumn += "&".freeze cpumn += ".urlencode" cpumn += "%20" cpumn += "(true)" cpumn += "(false)" cpumn += "(nil)" cpumn += "(not set)" cpumn += "(null)" cpumn += "(empty string)" cpumn += "(not set)" cpumn += "(null)" cpumn += "(empty string)" cpumn += "(null)" cpumn += "(null)" cpumn += "(null)" cpumn += "(not set)" cpumn += "(null)" cpumn += "(null)" cpumn += "(not set)" cpumn += "(null)" cpumn += "(not set)" cpumn += "(null)" puts "#{cpumns}.length. #{cpumns.length}" puts cpumns puts "#{row_separator}#{fields}#{field_separator}#{fields}#{field_separator}" puts "#{row_separator}#{fields}#{field_separator}#{fields}#{field_separator}" end
The process to integrate 403 Forbidden and 403 Forbidden may seem complicated and intimidating. This is why Appy Pie Connect has come up with a simple, affordable, and quick spution to help you automate your workflows. Click on the button below to begin.
How to Integrate Customerly with Airtable?
How to Integrate Customerly with uProc?
How to Integrate Customerly with MongoDB?
How to Integrate Customerly with snowflake?
How to Integrate Customerly with Knack?
How to Integrate Customerly with data247db?
How to Integrate Customerly with Quick Base?
How to Integrate Customerly with MongoDB Realm?