Working on projects that deal with large amounts of data comes with their own set of challenges. One of these challenges is figuring out how to transform data from one format to another. Oftentimes requirements call for data to be transformed from upper case to lower case, combining data like first name and last name, or extracting a small subset of data from a large chunk of text and that’s where String Manipulation shines.
This is the first of many blog posts about String Manipulation.
One of our clients is a travel company that wanted to extract a small chunk of data from a larger volume of information. The use case is for a travel chatbot to retrieve a trip's description based on the user-entered "From" and "To" locations. The chatbot will then simply extract the trip's description from the travel data. We will use that use case as an example in this post to showcase the power of string manipulation in Workato.
String Manipulation in Workato helps streamline a recipe's steps for extracting fields from an array of values and modifying it to produce the desired result. Workato’s inbuilt string manipulation function uses Ruby code in the background which makes it an easy-to-use no-code/low-code platform for developers and non-developers alike. Workato has exposed these functions in a simple way for anyone to use and transform data.
There are various types of String Manipulation functions one can use:
include?, exclude?, match?, parameterize, lstrip, rstrip, scrub, ljust, rjust, reverse, sub, length, slice,
and many many more.
In this post, we will specifically look at .gsub() and pluck() functions and how we used them in our customer use case effectively.
inputString.gsub(find, replace)
Where
Formula mode is displayed with the fx symbol
The editor displays a list of formulas that can be used with strings when a data-pill of the string type is dropped into an input field while in formula mode.
Formula editor showing the list of string formulas
Now let's look at how gsub and pluck are used in our use case.
The input data contains multiple description fields(along with a label). We need to extract each of these description fields quickly and send it to the chatbot in an order.
[
{
"Label": "Moving to New York",
"Description": "Traveling from London to New York to see Disney World.",
"SectionList":
{
"SectionName":
[
"Group": "Five friends travel to New York together"
]
}
},
{
"Label ": "Moving to Canada",
"Description": " Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.",
"SectionList":
{
"SectionName":
[
"Group”: “Six friends travel to France together "
]
}
},
{
"Label ": "Moving to Bermuda",
"Description": " Traveling from Canada to Bermuda to see Pink sand Beaches.",
"SectionList":
{
"SectionName":
[
"Group”: “Seven friends travel to Bermuda together "
]
}
},
{
"Label ": "Moving to Cuba",
"Description": " Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.",
"SectionList":
{
"SectionName":
[
"Group”: “Six friends travel to Bermuda together "
]
}
},
{
"Label ": "Moving to Newyork",
"Description": " Traveling from Cuba to New York to see Fascinating Architecture and to have Manhattan clam chowder.",
"SectionList":
{
"SectionName":
[
"Group”: “Five friends travel to Bermuda together "
]
}
}
]
The desired output should be a list of descriptions prefixed by a hyphen:
Description:
-Traveling from London to New York to see Disney World.
-Traveling from New York to Canada to see Niagara Falls and to have delectable foods.
-Traveling from Canada to Bermuda to see Pink sand Beaches.
-Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delectable foods and drinks.
-Traveling from Cuba to New York to see Fascinating Architecture and to have Manhattan clam chowder.
Here are the steps performed to extract the descriptions:
The data may contain more than one Description label, and we must remove all potential brackets (i.e. {, ], }, [, ) To distinguish between the descriptions, each description field must begin with a hyphen, and the following value should appear on the following line.
Data. pluck('Description').to_s. gsub (`"`,`-`). gsub (`[`,``). gsub (`]`,``). gsub(`-,`,`n`). gsub (`.-`,`.`)
Description:
[
"Traveling from London to New York to see Disney World.","Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.","Traveling from Canada to Bermuda to see Pink sand Beaches.","Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.","Traveling from Cuba to Newyork to see Fascinating Architecture and to have Manhattan clam chowder."
]
gsub (`"`,`-`):
Description:
“[
-Traveling from London to New York to see Disney World. -,-Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.-,-Traveling from Canada to Bermuda to see Pink sand Beaches.-,-Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.-,-Traveling from Cuba to Newyork to see Fascinating Architecture and to have Manhattan clam chowder.-
]”
gsub (`[`,``) and gsub (`]`,``):
Description:
"-Traveling from London to New York to see Disney World. -,-Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.-,-Traveling from Canada to Bermuda to see Pink sand Beaches.-,-Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.-,-Traveling from Cuba to Newyork to see Fascinating Architecture and to have Manhattan clam chowder.-"
We will then replace all the hyphen and comma pair with a new line(n) i.e., it will push the next description to next line.
gsub(`-,`,`n`):
Output:
" -Traveling from London to New York to see Disney World.
-Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.
-Traveling from Canada to Bermuda to see Pink sand Beaches.
-Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.
-Traveling from Cuba to Newyork to see Fascinating Architecture and to have Manhattan clam chowder.-"
The final step is to replace all the period and hyphen pairs with just a period.
gsub (`.-`,`.`)
Description:
" -Traveling from London to New York to see Disney World.
-Traveling from New York to Canada to see Niagara Falls and to have deilictable foods.
-Traveling from Canada to Bermuda to see Pink sand Beaches.
-Traveling from Bermuda to Cuba to see Fascinating Architecture and to have delictable foods and drinks.
-Traveling from Cuba to Newyork to see Fascinating Architecture and to have Manhattan clam chowder."
And there you have it! The stated string manipulation technique will aid in streamlining the recipe's steps for extracting the desired fields value from an array of values and modifying it to produce the desired result.
We hope this blog provided an in-depth description about String Manipulation in Workato using .gsub(). If you have any questions or feedback related to this article, please feel free to reach out to us using the “Contact Us” page.
Shiva is our Senior Software Engineer based out of our Bangalore office. His interests include playing cricket, traveling, and learning different languages. During his free time, he can be found solving math puzzles, mentoring, reading technical blogs, and cooking! With a never give up attitude and experience in various technology platforms, he's the Bangalore team's primary problem solver.
*CANDIDATES WOULD ALREADY BE SERVING A NOTICE PERIOD or IMMEDIATE JOINERS*
** HAVING WORKED IN A SMALL COMPANY OR STARTUP ENVIRONMENTS IS A BIG PLUS **
Our fast-growing company is currently seeking an experienced IT Project Manager. In this role, you will be hands-on, technical subject matter expert that will work closely with the sales team, clients and System integration / Business partners to identify client needs and propose effective solutions. You assume overall technical leadership and responsibility for designing solutions that leverage the capabilities across the organization’s portfolio.
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
We are looking for an Outbound Sales Development Representative (SDR) who can do Sales to (US – Focused more on North America Region) who is highly motivated, energetic, and coachable to work in a fast-growing startup. This role is extremely critical to achieve continued growth and account penetration for the company.
Mission: Find, nurture, and win solution-based deals in the company’s area of core competencies to achieve personal sales quotas and help achieve the company’s revenue goals.
As a Sales Development Representative (SDR) your primary responsibility will be to generate qualified leads and create sales opportunities for the sales team. You will play a crucial role in driving the growth of the company by identifying potential customers and initiating contact to build relationships. This position requires a proactive and results-oriented individual with excellent communication and organizational skills.
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
** We are looking for a B2B Sales Development Representative that is highly motivated, energetic and coachable to work in a fast growing startup. This role is extremely critical to achieve continued growth and account penetration for the company.**
Location: Bangalore, India
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
Reports To: Head of Sales
Mission: Find, nurture, and win solution-based deals in the company’s area of core competencies to achieve personal sales quotas and help achieve the company’s revenue goals.
This is a “hunter” role focused on net new business
Prospects will be mid-market and/or enterprise-level companies
Solution-selling methodology shall be used to accomplish mission goals
Relevant Domains of Knowledge: Candidate will be expected to be/become adept with the concepts, best practices, technology trends, platforms, and leading tools associated with:
Business Processes (Core processes for business units as well as B2B)
Systems Integration (iPaaS, APIs, Microservices, etc)
Data Integration (Data Stores for transactional and analytic data, Data virtualization, data governance, etc.)
Decision-Support Business Intelligence (Analytics, KPIs, Dashboards, Reporting, etc.)
Consultative Solution Selling
Project Lifecycle for Client Solution Development
Twenty20 Systems is a technology services company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
Reports To: Head of Sales
Mission: Find, nurture, and win solution-based deals in the company’s area of core competencies to achieve personal sales quotas and help achieve the company’s revenue goals.
This is a “hunter” role focused on net new business
Prospects will be mid-market and/or enterprise-level companies
Solution-selling methodology shall be used to accomplish mission goals
Relevant Domains of Knowledge: Candidate will be expected to be/become adept with the concepts, best practices, technology trends, platforms, and leading tools associated with:
Business Processes (Core processes for business units as well as B2B)
Systems Integration (iPaaS, APIs, Microservices, etc)
Data Integration (Data Stores for transactional and analytic data, Data virtualization, data governance, etc.)
Decision-Support Business Intelligence (Analytics, KPIs, Dashboards, Reporting, etc.)
Consultative Solution Selling
Project Lifecycle for Client Solution Development
Twenty20 Systems is a technology services company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
*CANDIDATES WOULD ALREADY BE SERVING A NOTICE PERIOD or IMMEDIATE JOINERS*
** Having worked in small companies or startup environments is a BIG plus **
** We are looking for highly motivated, energetic and coachable individuals seeking an opportunity in a fast growing startup with great benefits.**
Position: Senior Software Engineer
Location: Bangalore, India
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
As a Senior Data Engineer, You will be responsible for developing and maintaining data management solutions for our customer and organization. You will also be responsible for mentoring Associate Data Engineers and evangelizing the solution across organizations.
Location: Bangalore, India
Experience range: 3-6 years
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
As a Data Practice Lead, you will be responsible for strategizing and supporting the Data Management initiatives in the organization and customers. You will also be responsible for mentoring the Data Engineers and Associate Data Engineers on the data management practices and best practices to ensure a quality outcome is achieved. As a thought leader in the data space, you will also be responsible for generating, assisting and leading the organization’s data practice to build products.
Location: Bangalore, India
Experience range: 6-8 years
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
*CANDIDATES WOULD ALREADY BE SERVING A NOTICE PERIOD or IMMEDIATE JOINERS*
** HAVING WORKED IN A SMALL COMPANY OR STARTUP ENVIRONMENTS IS A BIG PLUS **
We are looking for highly motivated, energetic and coachable individuals seeking an opportunity in a fast growing startup with great benefits.
In this fast-paced digital economy, businesses of today look for partners that bring a modernized approach to technology solutions that provides their customers with new and innovative experiences. Twenty20 has been this
partner for numerous businesses over the past two decades with their deep technology & industry expertise.
Enterprises of today are moving away from ESBs and Legacy Middleware platforms toward Cloud-native serverless and modern architectures powered by iPaaS platforms that provide accelerated agility and business results. We, at Twenty20 Systems, enable this journey!
Twenty20 Systems and Denodo have partnered to combine expert consulting services expertise with the
industry’s leading data virtualization platform, to provide companies with impactful, data-driven insights that
accelerate speed-to-market.
We are looking for a highly energetic IT Project Coordinator to administer, organize and coordinate the various project activities. You should have excellent time management and communication skills, as you’ll collaborate with clients and internal teams to deliver results on deadlines. Ultimately, the Project Coordinator’s duties are to ensure that all projects are completed on time, within budget and meet high quality standards. The position is a Contract to Hire role.
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
*CANDIDATES WOULD ALREADY BE SERVING A NOTICE PERIOD or IMMEDIATE JOINERS*
** Having worked in small companies or startup environments is a BIG plus **
Position: Software Engineer
Location: Bangalore, India
Twenty20 Systems is a technology solutions company with a specialized focus in delivering business outcomes through a connected enterprise where all systems, applications, processes, services and people are seamlessly working together. Our mission is to further your vision – our experienced and passionate consulting resources bring deep expertise in the field of enterprise integration, digital transformation, cloud initiatives and business analytics.
We are looking for highly motivated, energetic and coachable individuals seeking an opportunity in a fast growing startup with great benefits.