简体   繁体   English

将选定的 excel 列转换为数据工厂 v2 中的 json 字符串

[英]Transform selected excel columns to json string in data factory v2

I am having the excel sheet with multiple columns.我有多列的excel表。 I need to transform selected column of excel sheet to json string and store in seperate column in excel using Azure Data Factory V2.我需要使用 Azure 数据工厂 V2 将 excel 表的选定列转换为 json 字符串并存储在 excel 的单独列中。

In data factory v2 using data flow we can create and update the existing columns using Derived Column Transformation.在使用数据流的数据工厂 v2 中,我们可以使用派生列转换创建和更新现有列。

I am having below excel file:我有以下excel文件:

在此处输入图片说明

With Azure Data Factory data flow, I need to transform the file to below:使用 Azure 数据工厂数据流,我需要将文件转换为以下内容:

在此处输入图片说明

Please let me know if this is possible to achieve in Derived Columns data flow transformation or I have to use custom activity to achieve the format.请让我知道这是否可以在派生列数据流转换中实现,或者我必须使用自定义活动来实现格式。

Yes, Data Flow could make it as a JSON string.是的,数据流可以将其作为 JSON 字符串。 But it's not a real JSON object.但它不是真正的 JSON 对象。

You could try bellow expressions:您可以尝试以下表达式:

concat('[{"',Column2,'":',Column3,'}]' )

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM