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 / Pivot column in sharep...
Power Automate
Unanswered

Pivot column in sharepoint List with Power automate

(0) ShareShare
ReportReport
Posted on by 50

Hey Guys!

 

I have the following sharepoint list:

 

iglesias6_0-1713193237919.png

 

 

I would like to create a new sharepoint list that gives me the following:

Cust_HighLevelVertical    Customer Name

Education                         New York City... ; Palm Beach Country... ; University of IOWA ; john hopkins university

Finance                             Banco Santander Rio S.A

 

Is there a way to create a flow with power automate to do this? How?

 

If not possible, how is the best way to do this?

 

Thanks a lot!

Categories:
I have the same question (0)
  • Verified answer
    Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Chriddle_0-1713195102486.png

    Compose

    [
    	{
    		"Name": "name 1",
    		"HighLevel": "Education"
    	},
    	{
    		"Name": "name 2",
    		"HighLevel": "Finance"
    	},
    	{
    		"Name": "name 3",
    		"HighLevel": "Education"
    	},
    	{
    		"Name": "name 4",
    		"HighLevel": "Education"
    	},
    	{
    		"Name": "name 5",
    		"HighLevel": "Finance"
    	}
    ]

     

    Select

    From

    xpath(
    	xml(json(concat('{"Root":{"Item":', outputs('Compose'),'}}'))),
    	'//HighLevel[not(preceding::HighLevel=.)]/text()'
    )

    Map Education

    item()

    Map Name

    join(
    	xpath(
    		xml(json(concat('{"Root":{"Item":', outputs('Compose'),'}}'))),
    		concat('//Item[HighLevel="', item(), '"]/Name/text()')
    	),
    	' ; '
    )

     

    Chriddle_1-1713195242428.png

     

  • iglesias6 Profile Picture
    50 on at

    Can you give me some explanations of what you are doing? Also, I have like one hundred different names. Is there a way to do this dynamic?

     

    Also, would you share with me that flow??

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Can you give me some explanations of what you are doing?

    The Select's From creates a list of distinct HighLevels

    In Map Name the xpath() creates an array of Names with that HighLevel which is then joined into a string.

     

     

    Also, I have like one hundred different names. Is there a way to do this dynamic?

    This is dynamic and can handle hundreds of different names

     

     

    Also, would you share with me that flow??

    I already deleted it, but these are only 2 actions. Just create them 😉 

  • iglesias6 Profile Picture
    50 on at

    All right!

    But I am not getting how I get a new sharepoint list out of this. I created one, and I want to put this outcome in it:

    iglesias6_0-1713268959212.png

     

    iglesias6_4-1713270765484.png

     

    So, when I test it, I get this:

     

    iglesias6_5-1713270860333.png

     

     

    And I would like to get this:

     

    Cust_HighLevelVerticalCustomer Name
    EducationNew York City... ; Palm Beach Country... ; University of IOWA ; john hopkins university
    FinanceBanco Santander Rio S.A

     

    I should be getting only once the "Education" row, only once the "Finance" row and so on. Also, I don´t want to get the "Name:name1" and that stuff. I believe I am not getting something from your response from before, sorry for that.

     

    Can you explain me again how I can get this outcome?

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    The Apply to each has to loop over body('Select')

    The create Item's Title has to be items('Apply_to_each')['Education']

    Customer value has to be items('Apply_to_each')['Name']

  • iglesias6 Profile Picture
    50 on at

    Following this steps, I am getting this:

     

    iglesias6_0-1713273015802.png

     

     

    Just in case, I am sharing my flow:

     

    iglesias6_1-1713273056731.png

     

    Why it is 

    "The create Item's Title has to be items('Apply_to_each')['Education']" 

    Shouldn´t it be something that includes all of my Cust_HighLevelVertical column?

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    My flow uses my data (in the Compose). And I use other property names.

    Therefore you have to integrate your data into my flow.

     

    One way (not the most elegant, but probably the easiest) is to include an additional Select right after your Get items:

    From: the values of your Get items

    Map Name: Customer Name (from the Dynamic Content)

    Map Education:  Cust_HighLevelVertical (from the Dynamic Content)

     

    Then replace my data in the Compose' with the body of this new Select.

     

  • iglesias6 Profile Picture
    50 on at

    Okey, I didnt get that you wanted to use another names and stuff, my bad.

     

    Now I am following better but I dont understand how my compose would be. Can you enter into detail there?

     

    iglesias6_0-1713278668858.png

     

    I know this is wrong, but how should it be?

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Clear the Compose's Input.

    Then add the expression body('Select_2')

  • iglesias6 Profile Picture
    50 on at

    Alright! This worked almost perfectly.

     

    I got this error only:

    The 'inputs.parameters' of workflow operation 'Create_item' of type 'OpenApiConnection' is not valid. Error details: The API operation 'PostItem' requires the property 'item/Customer' to be a string of maximum length '255' but is of length '332'.

    iglesias6_0-1713279424821.png

     

    Do you know how this can be fixed?

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