cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Input Array Was Empty, but it is not!

Hi All, i hope you can help me, i  have a sharepoint list containing records and another with criteria which to base an email flow, so if someone creates a record that has a certain reason code selected then an email is raised.

 

I have a field that has all the ids with a seperator. so i set an array variable to the field and then want to loop the array to check each id against the record, however when i hit the loop; flow is claiming it is empty, even though it clearly shows it is now empty, just incase youre wondering about the index reset stage, that is a different variable called index so im not clearing it myself! see below, thanks,

 

notempty.png

16 REPLIES 16
v-monli-msft
Community Support
Community Support

Hi @Anonymous,

 

Can you share the detailed configuration about this flow? I only see the errors but not what are those fields filled with. Also the column types that you are using in Flow.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

HI @v-monli-msft,

 

This flow loops through records on a sharepoint list so its as below:

 

initialise variables (array, index)

get a list of records

loop through records

{

   Get Record

   Get IDs String ('1;#;#2;#;#3;#;#')

   Get IDs string into array variable split([IDs],';#;#') result is: ["1","2","3"]

   Set Index variable to 1

   Set count varible to length of array result is 3

   Apply to all (array)

   {

        ARRAY IS EMPTY???

   }

}

 

 

its worth noting that if i create a test flow with only the below (using just a static string to split) it is working

 

   Get IDs string into array variable split('1;#;#2;#;#3;#;#,';#;#') result is: ["1","2","3"]

   Set Index variable to 1

   Set count varible to length of array result is 3

   Apply to all (array)

   {

        ARRAY IS NOT EMPTY

   }

hi!

 

Have you managed to work it out? I am facing the same issue, no matter if I pass an array to for each or if I turn my array into a JSON object. 

 

Regards,

Tomasz

Anonymous
Not applicable

Hi @TPoszytek,

 

I did not, i really think its a bug, however i did make another flow that has a similar loop since then and even though it says the array is empty, the loop must have been performed because a variable i make in that loop ended up bveing populated so i think its really just a bug in showing what happened in that loop. Try setting a variable in that loop and then take an action on that variable after it to see if it has been populated. you may find that the loop did indeed run but it just says it didnt.

 

Hope this helps

One more thing - I found out that this behavior is caused by the nested for each loops. If I move my for each loop outside the other one, iterator works fine. However when it is inside the other loop, it claims that my array/ object is empty. How that can be solved?

 

Regards,

Tomasz

Anonymous
Not applicable

Hi @TPoszytek,

 

Yes i absolutely agree with you, nested foreach loops is where the issue occurs, i have tried setting the loops to sequantial and the web requests so syncronous but this did not help. It is a bug and needs to be fixed. i was able to alter my thinking about the way my flow works and built up a string query to get exactly the data i wanted from my web request so i only needed 1 loop.

 

But this clearly needs to be fixed.

And I had worked it out by calling a second flow out of the loop in my first flow, passing the data to it, so that it handles the operations that the second loop was intended to handle. It has to be a bug unfortunately.

 

Regards,

Tomasz

@Anonymous one last thing - the release notes claim, that the nested for each should already be released: https://docs.microsoft.com/en-us/flow/release-notes: 2017-11-02_11h41_30.png

But it seems something still does not work  🙂

 

Regards!

 

 

Anonymous
Not applicable

@TPoszytek ahha, well it is, it just doesnt work properly :D.

PabloGomez
Frequent Visitor

This is an important issue. The nested foreach feature was very needed but this does not work. I've searched in the json definition of the flow but I see nothing wrong. I checked runAfter property is set ok.

😞

 

Please fix!

mdumitru
Regular Visitor

Did they fix it?

I don't think so.

 

I can do "nested loops" calling to another flow and transforming the inner array in the first flow in an outer array in the second flow using http calls. BUT this implies A LOT of flow executions... 

 

This is so hard to mantain if you have three nested arrays...

 

 

How is ComplianceReasons declared in your SP list? Is it a string-one line, string-multiple lines? 

I had a "similar" problem with objects extracted from SP list, then sent to a second flow via HTTP, I could see them when inspecting Run History, but when I finally tried to access them, Flow considered them empty. No loops involved in my case, so it is not exactly the same scenario.

Thanx!

Did I make your day? If so, mark my response as 'Solution' !!!

También escribo sobre Power Automate en este Blog y en Twitter

Anonymous
Not applicable

It is declared as single line, then the array is initialised and the string is split by a delimiter into the array which is clearly populated as shown.

Hi,

 

I made a very simple example of the "array is empty" issue. First loop works well but second loop doesn't see the array values. ¿Any ideas?

 

Thanks in advance

Flow definitionFlow definitionFlow executionFlow execution

I just ran into this problem as well. I was very confused as to why my nested array appeared empty while looping over it until I read this post.  Thank you for pointing it out, and I hope Microsoft is able to address this bug very soon. 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (985)