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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Zafar06
Frequent Visitor

Append Array Variable not working.

Date_range output is blank because date activity output is blank. 

Can you please help me fix the issue?

 

Date_range input 

date_range input.png

 

Date_range output

date_range output.png

  

date Append array variable inputdate append array variable input.png

 

date Append array variable output

date activity append array variable output.png

 

@frithjof_v  @v-yilong-msft

 

  

4 REPLIES 4
frithjof_v
Community Champion
Community Champion

@Zafar06 

 

I don't think that the array variable is empty, even if the output message is empty like this {}.

 

It seems like values like "2023-07-09" are being appended to your variable.

 

So I think your variable called 'days' actually contains an array of dates (each date formatted as strings like "xxxx-xx-xx").

 

Are you having issues utilizing that variable in a subsequent step?

yes, variables are not working. I am going to use each variable in API URL link ( example: relative url...general_ledger_accounting_date=Variable). Want retrieve data per day and append it. Otherwise data is so huge, it can not be loaded. 

Could you have a look in the pipeline run history and check if one copy activity gets executed for each date in your date range? 

Do you get any error messages?

 

 

Can you show what code you are using inside all of your activities? 

 

(Please hide any sensitive information)

 

Can you also show which variables you have in your pipeline and what type of variable they are (array, string, integer, etc.).

 

In general I think your approach should work but perhaps something which needs to be changed in the code.

 

 

 

One thing you can do if you want to verify the contents of the array variable ('myArrayVariable'), is to add a new string variable 'myStringVariable' and then in the step after the ForEach where you append values to your array variable ('myArrayVariable'), you can "print" the array variable to the string variable 'myStringVariable' by using set variable 'myStringVariable' and this expression: 

 

@join(variables('myArrayVariable'), ',')

 

frithjof_v_0-1722024214738.png

 

After the pipeline has run, you can inspect the output of the Set variable step for 'myStringVariable'.

 

frithjof_v_2-1722024728103.png

In this example screenshot, I have used the names DummyDateArray ('myArrayVariable') and JoinDummyDateArray ('myStringVariable').

 

 

I think this is an easy way to inspect the contents of the variable.

 

I'm not so experienced with data factory, and I don't know if there are some easier ways to inspect the contents of an array variable after a ForEach activity.

v-yilong-msft
Community Support
Community Support

Hi @Zafar06 ,

Glad to help again, I see you applied to ForEach.

vyilongmsft_0-1721787579947.png

vyilongmsft_1-1721787610244.png

So with those limitations in mind, I think you might want to take a look at this documentation, it might be able to help you: Data Pipeline Performance Improvements Part 2: Creating an Array of JSONs | Microsoft Fabric Blog | ...

vyilongmsft_2-1721787734013.png

vyilongmsft_3-1721787791377.png

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.