web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamically Create Arr...
Power Automate
Unanswered

Dynamically Create Arrays. and store data as required.

(0) ShareShare
ReportReport
Posted on by 19

NOTE: I can create this report using other means, but I am using this as means to further my understanding, knowledge and expertise of Flow.

 

I am working on building a report style flow - we have a text file that is appened to each time a user logs into a machine. the data we store is PCName, Username and Date/Time.

 

Report requirement: Produce a tailored email to each person identified in the list with the time they logged into their PC on a weekly basis.

 

Current Progress: I have created a variable of the target day, and I have a routine that converts splits each line of data (PCName, Username, DateTime) into an array, further splits each line into another array of each element, a further array that splits the DateTime and compares the date to our target date to see if we need to do anything.

 

The Problem: How do I create further arrays dynamically for each identified user? there could be 30 entries or 40 depending on attendance? I need to create an array for each user, within that array add a date and time of their "first" login - the solution if there is one would need to check to see if an array exsists before adding to it and creating one if it doens't.

 

I suspect this might be a little too complex for Flow at present, but hopefully i'm wrong...

 

Thank you in advance.

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at

    Hi @ScottCooper ,

     

    Unfortunately, there is no way to initial array variables dynamically. For example, I want to create multiple arrays according to the records of data, I may need the Apply to each action or Do until action, but if I put the initial variable action into it, it will return an error that The operation 'Initialize variable' can only be used at the top level.Annotation 2019-09-06 143243.png

    You can consider storing each row into a SharePoint list, the use the Get Items action to get each record, the process the string of each records into an array, then do the further step.Annotation 2019-09-06 143424.png

    Annotation 2019-09-06 144024.png

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • ScottCooper Profile Picture
    19 on at

    Thank you for your reply, as this is a training excercise so to speak i'm trying to do this entirely within Flow just to make it that much harder.

     

    But for a practical solution sharepoint lists do look a good route, and will be soemthing I deploy in the future. You have sparked an idea however. Rather than looping through once collecting data for all agents, it at first glance seems possible to loop through multiple times for each specific agent, after a little array filtering.

  • v-litu-msft Profile Picture
    on at

    Hi @ScottCooper,

     

    Yes, since the data is stored in the text file and its type is String, so it's difficult to parse.

    And cause the records are multiple, so we need to stack in a loop to process it after split the data. For some consideration, each time store it needs to empty the temp SharePoint list.

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard