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

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Concatenation of Year

(0) ShareShare
ReportReport
Posted on by 38

Hi All,

 

I currently have an SharePoint list (table 1) with the following:

 

PowerBI87_0-1595541288546.png

How would i create flow that can concatenate all years into 1 if the company is the same?

 

The output I need for list 2 is:

Table 1: 
CompanyYear
X2019
X2020
Y2017
Y2018
Y2019

 

Table 2: 
CompanyYear
X2019,2020
Y2017,2018,2019
Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @PowerBI87 

     

    There is a couple of ways you can do this. One of which is, initialize an array variable at the top of the flow and then add action to get items. create an apply to each loop to iterate over the items returned and then in the loop add a condition to check if the array contains the company name. If it does do nothing else, add append to array variable action and select the company name.

     

    Outside the loop, add another apply to each loop and this time iterate over the array and add the action filter array where you can provide the list returned from sharepoint to check if the company name is current  item from the array. This way you get filtered distinct companies. 

     

    Now, you can add another variable and from the filtered array, append the year values. 

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • PowerBI87 Profile Picture
    38 on at

    Thanks for your reply.

     

    Not sure if this is the right steps so far. Can you please comment?

     

    PowerBI87_0-1595598010090.png

     

    also not sure what to do outside of the loop.

     

  • DCReina Profile Picture
    107 on at

    Hey PowerBI87,

     

    You're close. I believe that he meant for you to not nest the two "For Each" actions...you may want to try something like this:

     

    DCReina_0-1595634855242.png

     

    Obviously, you'll have to account for my [...] suggestions since I don't have the values from your tables but you get the idea 🙂

     

    (Please "Like" and "Accept" any helpful responses!)

  • PowerBI87 Profile Picture
    38 on at

    Thank you. I followed your instructions and came up with this.

     

    image.png

     

    However flow is failing when in the initialize variable step. Any idea what's wrong?

     

     

    image.png

  • DCReina Profile Picture
    107 on at

    Since the error is indicating that it doesn't like the output for some reason, could you the trigger/actions above the variable? Both the normal view into the cards and then the expanded test view that shows the inputs/outputs?

     

    I'm wondering if you are getting the right values for your lists (i.e. the arrays and not the singular value of the SharePoint list itself (i.e. the object of the list)...thoughts?

  • PowerBI87 Profile Picture
    38 on at

    1.PNG2.PNG3.PNG4.PNG5.PNG

     

    "Year of Update" is the field in SFS Notification Template T1 list that the output should go to. ( in picture 4)

  • DCReina Profile Picture
    107 on at

    DCReina_0-1595900210021.png

    I'm guessing that it's because it's unable to resolve you getting the same list twice? That's the only thing I can think of off the top of my head since all of the steps you have below the "initialize variable" step won't actually run until that action passes.

     

    Thoughts?

  • PowerBI87 Profile Picture
    38 on at

    I'm not sure how to proceed. Any other ideas?

  • DCReina Profile Picture
    107 on at

    I believe that you have to resolve one of those actions...in other words, do you really need both? I'm not sure what you're trying to accomplish with the entire Flow so it's difficult for me to fully understand what you're going for...

     

    Would love to help...just need as much context as you can provide.

  • PowerBI87 Profile Picture
    38 on at

    Thank you for you efforts in trying to assist me.

     

    I am essentially trying to grab data from one list (List 1), and populate items from list 1 into list 2 and list 3.

     

    I believe I need both triggers.

     

    I need Get item(so I can use those items to populate fields in this step:

     

    PowerBI87_0-1595968760830.png

     

    i need Get itemto initialize variable 'List of Items'

     

    PowerBI87_1-1595968843781.png

     

     

     

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard