Loading...

ADF\Synapse Analytics - Replace Columns names using Rule based mapping in Mapping data flows

ADF\Synapse Analytics - Replace Columns names using Rule based mapping in Mapping data flows

In real time, the column names from source might not be uniform, some columns will have a space in it, some other columns will not.

For example,

  • Sales Channel
  • Item Type,
  • Region
  • Country
  • Unit Price

It is a good practice to replace all the spaces in a column name before doing any transformation for easy handling. This also helps with auto mapping, when the sink column names do not come with spaces!

 

Select transformation in data flow makes it simpler to automatically detect spaces in column names and then remove them for the rest of the dataflow.

 

Consider the below source, with the given column names.

 

Screenshot 2024-01-25 at 3.11.13 PM.png

 

Here as we can see, few columns have spaces, few columns like Region and Country do not have spaces in it. 

 

Using the below configuration in select transformation, we can get rid of the spaces in the column names with a simple expression. 

 

In the Input columns, Click on Add mapping button, and choose Rule-based Mapping.

Screenshot 2024-02-22 at 4.42.57 PM.png

Then give the below expression:

on Source1's column: true()

on Name as column: replace($$,' ','')

 

Screenshot 2024-01-25 at 3.10.04 PM.png

What it does?

It will return true() for all the columns which have ' ' (space) in it and replace it with '' (no space).

Upon data preview, we get to see the below result,

 

Screenshot 2024-01-25 at 3.17.50 PM.png

 

As we are seeing here, all the columns with spaces are coming without spaces in between. 

If not for the Rule based mapping, one would have to manually remove space from all the columns. It would be a nightmare if the number of columns are more! Thanks to rule-based mapping!

Published on:

Learn more
Azure Synapse Analytics Blog articles
Azure Synapse Analytics Blog articles

Azure Synapse Analytics Blog articles

Share post:

Related posts

Types of Power Automate Flows

Welcome to Power Automate! This article focuses on differentiating the three types of Power Automate cloud flows: scheduled, instant and autom...

11 hours ago

Copy and Paste in Power Automate Classic vs New UI

Copy and Paste has existed for a while in the classic Power Automate UI. With the new UI however there are a few additional features in this a...

3 days ago

Power Automate: Retiring the Impala connector

The Impala connector will be retired and removed from Copilot Studio, Logic Apps, Power Apps, and Power Automate between April 1-14, 2026. Exi...

5 days ago

Power Automate: Get support for normalized schema import for data ingestion

Customers with existing data pipelines or data products in data mesh mostly want to stick to normalized, efficient forms such as star schema. ...

10 days ago

Power Automate: Export object-centric process mining data to Microsoft Fabric semantic model

Publishing to Microsoft Fabric breaks down data silos and amplifies the impact of your process insights across your organization. Instead of k...

10 days ago

Power Automate: Create and visualize custom KPIs in Process Intelligence Studio

Custom KPIs put your unique business priorities at the center of process analysis. While standard metrics provide valuable baseline insights, ...

10 days ago

Power Automate: Analyze your processes in Process Intelligence Studio

Process Intelligence Studio eliminates the friction between your questions and your answers. Instead of navigating rigid dashboards or using a...

10 days ago

Power Automate: Configure Entra hybrid join for hosted machine groups

Microsoft Entra hybrid join with custom virtual networks (VNETs) and hosted machine groups lets your hosted machine group bots enroll in both ...

10 days ago

Power Automate: Enable version control for desktop flows

With version control in Power Automate for desktop, you can see what changes were made and who made them. This feature makes it easier to debu...

10 days ago

Power Automate: Use Power Platform environment variables in desktop flows

Retrieve Power Platform environment variables directly through their desktop flows without the need to pass them as inputs to the flow. A new ...

10 days ago
Stay up to date with latest Microsoft Dynamics 365 and Power Platform news!
* Yes, I agree to the privacy policy