LogoLogo
ProductsPricingGlossary Launch Acho
  • 🎉Welcome
  • Introduction
  • What is Acho?
  • How does Acho work?
    • Proof of Concept (PoC)
  • App Builder
    • Get Started
    • Core Concepts
    • Overview
    • App construction
      • App Configuration
      • Pages
      • Interactions
        • Add an interaction
        • Add conditions to interactions
        • Event payload
        • Ordering interactions with action flow
        • Transformer
        • Actions
          • Navigation
          • Element
          • Data Source
          • App
          • Page
          • API Service
          • Database
          • Media Service
      • Table
      • Metric
      • Query
      • Data Store
      • Elements
        • Table & Chart
          • Searchable Table
          • Table
          • Chart
          • Score Card
        • Form Elements
          • Form
          • Search Bar
          • Checkbox
          • Date Picker
          • Custom Form
          • Input
          • Multiselect
          • Radio Button
          • Radio List
          • Rich Text Editor
          • Select
          • Switch
          • Textarea
          • Upload
        • Web Elements
          • Badge
          • Button
          • Clickable
          • Collapse Menu
          • Divider
          • Icon
          • Image
          • Link
          • Message
          • Modal
          • Notification
          • Pagination
          • Popover
          • Rate
          • Rich Text
          • Tabs
          • Text
        • Layout Elements
          • Container
          • List
        • Advanced elements
          • Code Block
          • Condition
          • Print
        • CSS Styles
          • General techniques
          • Layout
          • Spacing
          • Size
          • Position
          • Typography
          • Background
          • Border
          • Effect
        • Form Check
        • Tooltip
      • Accessors
      • Plugin Store
    • Popular Use Cases
      • Build a chart from Table Nodes
      • Create a table
      • Create a list
      • Create a filter
      • Create a search bar
      • Use Custom Form Container to collect user inputs
      • Drill down on a table
      • Download file from query node
      • Set loading animations
      • Modify a database
      • Navigate to a different page
      • Set up dynamic routing
      • Update app data using accessors
      • Create a Chart with Code Block and D3 Library
      • Rich text and rich text editor
      • Send an Email via Mailjet Plugin
    • Preview
    • Publish
      • Embed published app on website
    • Version Control
    • App User Management
      • Onboarding Page
      • Sign in page
      • Guest Isolation and Private Session
    • Theme
    • FAQ
  • Acho Studio
    • Quick Start
    • Resources
      • Add a resource
      • Supported data sources
        • Airtable
        • Amazon Ads
        • Amplitude
        • Amazon Seller Partner
        • Apify Dataset
        • Appstore
        • Asana
        • API Connector
        • API Template
        • AWS CloudTrail
        • Azure Table Storage
        • Batch Files
        • Bamboo HR
        • BigCommerce
        • BigQuery
        • Bing Ads
        • Braintree
        • Cart.com
        • Chargebee
        • Chargify
        • Chartmogul
        • Clickhouse
        • Close.com
        • CockroachDB
        • Confluence
        • Customer.io
        • Delighted
        • Dixa
        • Drift
        • Facebook Marketing
        • Freshdesk
        • Freshsales
        • Freshservice
        • GitHub
        • GitLab
        • Google Ads
        • Google Analytics
        • Google Sheets
        • Google Search Console
        • Greenhouse
        • Harness
        • Harvest
        • HubSpot
        • IBM Db2
        • Instagram
        • Intercom
        • Iterable
        • Jenkins
        • Jira
        • Kafka
        • Klaviyo
        • Kustomer
        • Lemlist
        • Lever Hiring
        • LinkedIn Ads
        • Linnworks
        • Mailchimp
        • Marketo
        • Microsoft Teams
        • Mixpanel
        • Monday
        • MongoDB
        • MySQL
        • My Hours
        • NetSuite
        • Notion
        • Okta
        • OneDrive
        • OneSignal
        • Oracle DB
        • Outreach
        • PagerDuty
        • Paypal Transaction
        • Paystack
        • Pipedrive
        • PersistIq
        • Pinterest
        • Plaid
        • PostgreSQL
        • PostHog
        • PrestaShop
        • Qualaroo
        • QuickBooks
        • Recharge
        • Recurly
        • Remote File
        • S3
        • Salesforce
        • Salesloft
        • SearchMetrics
        • Sendgrid
        • Sentry
        • Short.io
        • Shopify
        • Single File
        • Slack
        • Smartsheets
        • Snapchat Marketing
        • Snowflake
        • SQL Server
        • Square
        • Stripe
        • SurveyMonkey
        • Tempo
        • TikTok Marketing
        • Trello
        • Twilio
        • Typeform
        • VictorOps
        • WooCommerce
        • YouTube Analytics
        • Zendesk Chat
        • Zendesk Sunshine
        • Zendesk Talk
        • Zendesk Support
        • Zenloop
        • Zoho CRM
        • Zoom
        • Zuora
    • Data Prep (Projects)
      • Create a Data Prep Project
        • Create a table tab
        • Copy a table tab
        • Hide a table tab
      • Apply an action
        • View
          • Hide Columns
          • Filter
          • Sort
          • Cut
          • Rename
          • Move Column
        • Combine Tables
          • Join
          • Union
        • Transformation
          • Pivot Table
          • Unpivot
        • Data Cleaning
          • Cleanse
          • Replace
          • Change Type
          • Deduplicate
          • Split
          • Flatten
        • Tools
          • Formula
          • SQL Editor
            • SQL Editor Queries
            • All functions in Formula/SQL
              • Mathematical Functions
              • String Functions
              • Date Functions
              • Datetime Functions
              • Time Functions
              • Timestamp Functions
              • Conditional Functions
              • Type Conversion
              • Other Functions
        • Reserved Keywords
      • Pipeline
      • Edit your pipelines
      • Generate column summary for inspection
      • Use URL to access and share your project
      • Write a description for your project
      • Delete a resources/project/tab
    • Data Flow
      • Export data
        • Download CSV files
        • Excel Connector
        • Google Sheets Connector
        • Embed a table on your website
          • Data Usage Agreement
        • Apache Superset
        • Chartio
        • Looker
        • Metabase
        • Power BI
        • Qlik
        • Tableau
        • MongoDB
        • MySQL
        • MSSQL
        • Snowflake
        • PostgreSQL
        • BigQuery
    • Set up Data Sync
    • FAQ
  • Organization
    • Get started
    • Create an organization
    • Invite people to your organization
    • Share your resources
    • Share your projects
    • Share your apps
    • Change payment method on file
  • FAQ
    • I can't find data after uploading a big CSV file
Powered by GitBook
On this page
  • Flatten JSON
  • 1. What is a JSON object?
  • 2. How to extract values from JSON?
  • 3. How to identify available keys when the JSON object has multiple keys?
  • Flatten Array
  • 1. What is an array?
  • 2. How to flatten values from an array?

Was this helpful?

  1. Acho Studio
  2. Data Prep (Projects)
  3. Apply an action
  4. Data Cleaning

Flatten

If your data is from API, you may see some values are presented within curl brackets {} or square brackets []. Generally, the one with curl brackets is called a JSON object, whereas the other one with square brackets is called an array. These data types contain lots of information in a single cell and are not easy to analyze. Thus, Flatten action is to solve this issue.

You can go to the table that includes JSON objects or arrays and navigate to Data Cleaning > Flatten. Then, select the column that you want to flatten and select the corresponding method.

Flatten JSON

1. What is a JSON object?

JSON represents JavaScript Object Notation and is one kind of data type.

{"Product":"Milk", "Sales":1200}

Generally, JSON has the following characteristics:

  • Values are presented within a pair of curl brackets {}.

  • All values within the brackets are "key-value" pairs. That is, each key has a corresponding value and keys cannot be duplicated.

  • Values can be any data type, such as String, Integer, Date, or even another JSON object.

  • The strings with quotes before the colon, : are the names of the keys. For example, the object above has two keys, Product and Sales. The value of Product is "Milk", and the value of Sales is 1200.

2. How to extract values from JSON?

Step 1: Go to the table that includes JSON objects and navigate to Data Cleaning > Flatten.

Step 2: Choose a column and select Flatten JSON. (All JSON columns are presented in a String data type)

Step 3: Type the keys that you want to extract values from. Here you can type several keys, and you can enter space to separate each key. (Remember to click Enter when you finish a keyword.)

3. How to identify available keys when the JSON object has multiple keys?

The following example is the result after using JSON Formatter, so you can see available keys in the first level are price, rate, title, price_set, and channel_liable.

{
   "price":"8.07",
   "rate":0.0625,
   "title":"Massachusetts State Tax",
   "price_set":{
      "shop_money":{
         "amount":"8.07",
         "currency_code":"USD"
      },
      "presentment_money":{
         "amount":"8.07",
         "currency_code":"USD"
      }
   },
   "channel_liable":false
}

Flatten Array

1. What is an array?

Like JSON, arrays are another kind of data type and usually present values within a pair of square brackets []. All values in an array are separated by commas and should have the same data type. For example, all values in the following array are integers, so you will not see any string or boolean. However, it is allowed to have Nulls in an array. The number of elements in an array can be from 0 to infinite.

[2, 3, 0, 1, 5, Null]

2. How to flatten values from an array?

Step 1: Go to the table that includes JSON objects and navigate to Data Cleaning > Flatten.

Step 2: Choose a column and select Flatten Array. Note that you can only choose columns in an Array data type.

Step 3: The system will separate each element into different rows and put these values in another column.

PreviousSplitNextTools

Last updated 3 years ago

Was this helpful?

Step 4: The system will extract a specific key's value from each row and put these values in another column. The new column will have a prefix of the original JSON column. (You can use action to change the column name)

Note: The Flatten action will convert all values extracted from JSON into String, no matter which data types they originally are. You can use action to correct their types.

If your JSON object has dozens of keys, or it is a complicated nested JSON object with several levels, you can use to help yourself to identify available keys. The tool can convert the JSON object into a readable and structured format.

Step 4: Each element in an array will be separated into different rows as shown below. The new column will have a prefix of the original Array column. (You can use action to change the column name)

Rename
Change Type
JSON Formatter
Rename