Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
pmcmonag2
Regular Visitor

Unable to configure 'Copy data' activity for csv output from API - Marketo

Scenario:
I am trying to download a csv file in a pipeline but due to the schema of the response being csv (not json) a Copy Activity fails with the error:

 

Error:
Error occurred when deserializing source JSON file ''. Check if the data is in valid JSON object format.
Unexpected character encountered while parsing value: e. Path '', line 0, position 0.

 

I think this is due to the file in the response actually being csv format. In postman the csv delimited response returns fine. In the format:

pmcmonag2_2-1718798020064.png

 

Workarounds attempted:

1. Tried to add an accept header in the call in the Copy Data Activity. This does not work/allowed.

pmcmonag2_3-1718798149114.png

 

2. a Added a web activity to parse the response instead. Insepcting the output on running the pipeline looks like, where #### is the csv response including headers as in postman response.

{
"Response":{#######}
"ResponseHeaders": {
"Connection": "keep-alive",
"Date": "Thu, 13 Jun 2024 13:16:10 GMT",
"Server": "nginx",
"Content-Length": "917457",
"Content-Disposition": "attachment; filename=file",
"Content-Type": "text/csv; charset=UTF-8"
},
"executionDuration": 1
}

 

The issue here is there is no option in Fabric to add a sink for this output, or as in ADF created an inline dataset linked to blob storage. 

 

It is possible to add a setVariable activity and just get the .Response array which contains the csv, but as above it cannot be output anywhere. 

 

2 b) adding a new Copy Data Activity after the set variable there is no the option to have the input as a dynamic output (inline), the source must be a Fabric object:

pmcmonag2_1-1718796528091.png

 

Questions:

1. Can the Copy data activity be configured to take a csv response (rather than json)?

2. What is the Fabric alternative to creating a linked dataset to output a response or variable? (to output web activity response)

3. Can the Copy data activity be configured to accept output from an activity (like a variable)? (rather than a fabric entity like a warehouse/lakehouse)

5 REPLIES 5
pmcmonag2
Regular Visitor

Hi @v-cboorla-msft Support ticket now created - Case 2407100050001204 

Thanks

v-cboorla-msft
Microsoft Employee
Microsoft Employee

Hi @pmcmonag2 

 

Thanks for using Microsoft Fabric Community.

1. Can the Copy data activity be configured to take a csv response (rather than json)?

  • Currently, the Microsoft Fabric Copy data activity is not directly configured to take a CSV response from a REST API call. While the Copy data activity can work with structured data formats like CSV (typically delimited text formats), it requires the data to be presented in a way it can parse. Directly interpreting a raw CSV response from a web activity might necessitate additional processing. However, it can handle delimited text files (like CSV) stored in Azure Blob Storage.

2. What is the Fabric alternative to creating a linked dataset to output a response or variable? (to output web activity response)

  • In Microsoft Fabric, you can leverage the "For Each" activity to iterate through the array of responses obtained from the Web activity. Within this loop, you can utilize a nested "Copy data" activity to process each individual CSV response as a dataset. This approach allows you to handle the CSV data effectively. This approach allows you to treat the CSV data as a dataset within the Copy data activity.

3. Can the Copy data activity be configured to accept output from an activity (like a variable)? (rather than a fabric entity like a warehouse/lakehouse)

  • It's important to note that the Copy data activity in Microsoft Fabric cannot directly accept output from an activity (like a variable) as its source. It requires a Fabric object (warehouse, lakehouse) as the input. Therefore, an intermediate approach like the "For Each" activity becomes necessary to process the CSV data retrieved from the Web activity.

I hope this information helps.

 

Thank you.

Thanks for the responses @v-cboorla-msft .

 

I still don't quite understand how the ForEach approach in 2) can be implemented, as doesn't the restriction you call out in 3) still apply? It's important to note that the Copy data activity in Microsoft Fabric cannot 

directly accept output from an activity (like a variable) as its source


The CopyData within the Foreach Loop still appears to require a Fabric object (lakehouse) as a source?

pmcmonag2_0-1718883496295.png


Perhaps easier to understand the output if I save off just the 'Response' off the call in a variable.

pmcmonag2_0-1718884710351.png

{ "name": "CSVResponse",
"value": "email,firstName,lastName,company,leadScore\npmcmcmonag@microsoft.com,Pat,McMonag,Microsoft,null\n
}

But this still makes it no easier to use CopyData within a ForEach?

 

Hi @pmcmonag2 

 

Apologies for the inconvenience and the delay in reponse.

Please reach out to our support team to gain deeper insights and explore potential solutions. It's highly recommended that you reach out to our support team. Their expertise will be invaluable in suggesting the most appropriate approach.

Please go ahead and raise a support ticket to reach our support team:

https://support.fabric.microsoft.com/support

After creating a Support ticket please provide the ticket number as it would help us to track for more information.

 

Thank you.

Hi @pmcmonag2 

 

We haven’t heard from you on the last response and was just checking back to see if you've had a chance to submit a support ticket. If you have, a reference to the ticket number would be greatly appreciated. This will allow us to track the progress of your request and ensure you receive the most efficient support possible.

 

Thank you.

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Solution Authors