<?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: Store Activity Data into a Table in Pipelines</title>
    <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4687033#M7765</link>
    <description>&lt;P&gt;The following works;&lt;BR /&gt;&lt;BR /&gt;1) Feed the output of the Get MetaData activity into a parameter of a Notebook Activity&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;string(activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Get Metadata1'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;childItems&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2) Have a Notebook similiar to the following - attach it to a lakehouse&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;metadata_json = json.loads(metadata)&lt;BR /&gt;df = spark.createDataFrame(metadata_json)&lt;BR /&gt;df.write.mode('overwrite').saveAsTable('get_metadata')&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) When the pipeline is run, this is what gets output;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this helps, please consider &lt;EM&gt;Accepting as a Solution&lt;/EM&gt; to help others find it more easily.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 09 May 2025 19:08:52 GMT</pubDate>
    <dc:creator>spencer_sa</dc:creator>
    <dc:date>2025-05-09T19:08:52Z</dc:date>
    <item>
      <title>Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4683208#M7741</link>
      <description>&lt;P&gt;I am wanting to store the data collected from the Get Metadata activity into a lakehouse table, along with the Copy Data activity output for each table loaded in the ForEach activity. I have tried using variables of type array, and have now been testing out system variables. I haven't had any luck with figuring it out so far. Does anyone have any suggestions?&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 12:35:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4683208#M7741</guid>
      <dc:creator>jpelham</dc:creator>
      <dc:date>2025-05-07T12:35:35Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4683267#M7742</link>
      <description>&lt;P&gt;Ive stored web activity output (which is basically the same) in a warehouse before using the script activity.&lt;BR /&gt;&lt;BR /&gt;It is kinda hacky though, so a proper way would definitely be better, a stored procedure should work as well i think and be a bit cleaner already but i havent tried it&lt;BR /&gt;&lt;BR /&gt;Heres example code for the script activity:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DECLARE @DynamicSQL NVARCHAR(MAX);
DECLARE @JsonData NVARCHAR(MAX) = '@{variables('
data')}';
-- Replace the pipeline expression with the actual value at runtime
SET @DynamicSQL = '
IF ISJSON(''' + REPLACE(@JsonData, '''', '''''') + ''') = 1
BEGIN
    INSERT INTO ApiDataTable (RowId, RandomNumber, RandomString, RandomDate)
    SELECT 
        randomId, 
        randomNumber, 
        randomString, 
        randomDate
    FROM OPENJSON(''' + REPLACE(@JsonData, '''', '''''') + ''')
    WITH (
        randomId VARCHAR(100) ''$.randomId'',
        randomNumber VARCHAR(100) ''$.randomNumber'',
        randomString VARCHAR(100) ''$.randomString'',
        randomDate VARCHAR(100) ''$.randomDate''
    );
    
    SELECT CONCAT(''Successfully inserted '', @@ROWCOUNT, '' rows into ApiDataTable'') AS Result;
END
ELSE
BEGIN
    SELECT ''Error: Invalid JSON data. Please check the format.'' AS Result;
END';
EXEC sp_executesql @DynamicSQL;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 13:26:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4683267#M7742</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-05-07T13:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4685605#M7756</link>
      <description>&lt;P&gt;If you explicitly want the Get Metadata activity data in a table, then it is possible to have a notebook with a string input parameter, feed the activity output into the parameter of the Notebook Activity, and then parse the json in python and write the subsequent output to a delta table using pyspark.&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 20:59:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4685605#M7756</guid>
      <dc:creator>spencer_sa</dc:creator>
      <dc:date>2025-05-08T20:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4686822#M7763</link>
      <description>&lt;P&gt;Thanks! I will give that a try!&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 15:23:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4686822#M7763</guid>
      <dc:creator>jpelham</dc:creator>
      <dc:date>2025-05-09T15:23:49Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4686830#M7764</link>
      <description>&lt;P&gt;Thanks for the suggestion! I tried doing a stored procedure and it wasn't quite working how I had hoped and it was getting kind of messy to work with. I'll give this a try if the other solution doesn't work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 15:32:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4686830#M7764</guid>
      <dc:creator>jpelham</dc:creator>
      <dc:date>2025-05-09T15:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4687033#M7765</link>
      <description>&lt;P&gt;The following works;&lt;BR /&gt;&lt;BR /&gt;1) Feed the output of the Get MetaData activity into a parameter of a Notebook Activity&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;@&lt;/SPAN&gt;&lt;SPAN&gt;string(activity(&lt;/SPAN&gt;&lt;SPAN&gt;'Get Metadata1'&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;childItems&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;2) Have a Notebook similiar to the following - attach it to a lakehouse&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;
&lt;DIV&gt;metadata_json = json.loads(metadata)&lt;BR /&gt;df = spark.createDataFrame(metadata_json)&lt;BR /&gt;df.write.mode('overwrite').saveAsTable('get_metadata')&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) When the pipeline is run, this is what gets output;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If this helps, please consider &lt;EM&gt;Accepting as a Solution&lt;/EM&gt; to help others find it more easily.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 19:08:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4687033#M7765</guid>
      <dc:creator>spencer_sa</dc:creator>
      <dc:date>2025-05-09T19:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4691004#M7789</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739553" data-lia-user-login="jpelham" class="lia-mention lia-mention-user"&gt;jpelham&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for reaching out to Microsoft Fabric Community.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="679603" data-lia-user-login="spencer_sa" class="lia-mention lia-mention-user"&gt;spencer_sa&lt;/a&gt;&amp;nbsp; and&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; for the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Tue, 13 May 2025 13:23:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4691004#M7789</guid>
      <dc:creator>v-sathmakuri</dc:creator>
      <dc:date>2025-05-13T13:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4695885#M7830</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739553" data-lia-user-login="jpelham" class="lia-mention lia-mention-user"&gt;jpelham&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!!&lt;/P&gt;</description>
      <pubDate>Fri, 16 May 2025 11:47:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4695885#M7830</guid>
      <dc:creator>v-sathmakuri</dc:creator>
      <dc:date>2025-05-16T11:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: Store Activity Data into a Table</title>
      <link>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4700515#M7858</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="739553" data-lia-user-login="jpelham" class="lia-mention lia-mention-user"&gt;jpelham&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I&amp;nbsp;hope this information provided is helpful. Feel free to reach out if you have any further questions or would like to discuss this in more detail. If responses provided answers your question, please&amp;nbsp;accept it as a solution&amp;nbsp;so other community members with similar problems can find a solution faster.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 17:42:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Pipelines/Store-Activity-Data-into-a-Table/m-p/4700515#M7858</guid>
      <dc:creator>v-sathmakuri</dc:creator>
      <dc:date>2025-05-20T17:42:04Z</dc:date>
    </item>
  </channel>
</rss>

