<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pushing inner forEach activities to an outer variable in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4062506#M4722</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Currently Data Factory supports Run a Script activity and send an output summary by email.&lt;/P&gt;
&lt;P&gt;I think you can create a Data pipeline and then select Script in the Activities.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then break it down in detail based on the formatting that needs to be changed.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Eventually it would be possible to push the internal forEach activity to an external email as a Script.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2024 02:12:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-07-26T02:12:24Z</dc:date>
    <item>
      <title>Pushing inner forEach activities to an outer variable</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4061659#M4715</link>
      <description>&lt;P&gt;Is there any way to push the output value of forEach activity to an outer variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;E.g.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;For example,&lt;/P&gt;
&lt;P&gt;Lookup is a SQL look up that returns following and Filter activity filters based on filter_action = 'include'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;// output value Lookup
{
	"count": 2,
	"value": [
		{
			"id": 1,
			"filter_action": "include"
		},
		{
			"id": 2,
			"filter_action": "include"
		},
		{
			"id": 3,
			"filter_action": "exclude"
		}		
	]
}

//output value Filter
{
	"ItemsCount": 2,
	"FilteredItemsCount": 2,
	"Value": [
		{
			"id": 1,
			"filter_action": "include"
		},
		{
			"id": 2,
			"filter_action": "include"
		}	
	]
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am storing the output of filter in a variable and based on the array in Filter I am doing Copy Activity forEach objects present in Value array of Filter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While the copying is taking place forEach ingestion how can I access the outer Variable to copy the output of Copy Activity in the same variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Equivalent Javascript code of what I am hoping to achieve in pipeline&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it doable?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jul 2024 17:25:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4061659#M4715</guid>
      <dc:creator>smpa01</dc:creator>
      <dc:date>2024-07-25T17:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing inner forEach activities to an outer variable</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4062506#M4722</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="24978" data-lia-user-login="smpa01" class="lia-mention lia-mention-user"&gt;smpa01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Currently Data Factory supports Run a Script activity and send an output summary by email.&lt;/P&gt;
&lt;P&gt;I think you can create a Data pipeline and then select Script in the Activities.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then break it down in detail based on the formatting that needs to be changed.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Eventually it would be possible to push the internal forEach activity to an external email as a Script.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yilong Zhou&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;helps&lt;/I&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;I&gt;Accept it as the solution&lt;/I&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 02:12:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4062506#M4722</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-26T02:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Pushing inner forEach activities to an outer variable</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4063581#M4734</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If your variable is of type 'Array', then the 'Append variable' activity can be used inside each foreach iteration to dynamically append new items to the array variable.&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/append-variable-activity" target="_blank" rel="noopener"&gt;Append variable activity - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Afterwards, the array variable (with the data from the foreach activity) will be accessible for subsequent pipeline activities outside of the foreach activity.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the Collection functions are useful for accessing the data from the array variable in subsequent steps:&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/fabric/data-factory/expression-language#collection-functions" target="_blank" rel="noopener"&gt;Expressions and functions - Microsoft Fabric | Microsoft Learn&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also other functions and activities can be useful.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2024 10:30:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Pushing-inner-forEach-activities-to-an-outer-variable/m-p/4063581#M4734</guid>
      <dc:creator>frithjof_v</dc:creator>
      <dc:date>2024-07-26T10:30:16Z</dc:date>
    </item>
  </channel>
</rss>

