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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create HTML table from...
Power Automate
Unanswered

Create HTML table from Sharepoint List with multi-selection choose

(0) ShareShare
ReportReport
Posted on by 19

Hi All!

I want to build an HTML table from a Sharepoint list and then paste it into an email.

Scrennshot2.jpg

The problem is that one of the columns in the Sharepoint list contains multi-selection. To extract value from multi-select I use the expression:

 

first(body('Get_items')?['Value'])?['Region']

 

Screenshot_1.png

But when I run a flow in a multi-select column I get the following:

 

[{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":"Armenia"},
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":4,"Value":"Kazakhstan"},
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":5,"Value":"Kyrgystan"},
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":11,"Value":"Uzbekistan"}]

 

 

Screenshot_2.png

How to create HTML table in such a way that I see multi-select values in the corresponding column without additional information? In my case only Armenia, Kazakhstan, Kyrgyzstan, Uzbekistan without [{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":0,"Value":  🙄

 

Thanks in advance
Anton
Categories:
I have the same question (0)
  • Verified answer
    AdemarUrbano Profile Picture
    on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    Hi @Anton_Sysoev,

     

    In the Select action card you are already setting the initial value as "body('Get_items')?['Value']". 

     

    When you set the Region field you should use: first(item()?['Choice'])?['Value']

    But this will only show you the first "Choice".

     

    Instead, You can try to use this expression: 

            

     

     

    xpath(xml(json(concat('{"root":{"choices":', item()?['Region'] , '}}'))), '/root/choices/Value/text()')​

     

     

     
    It should return all the values like: ["Armenia", "Kazakhstan", "Kyrgyzstan", "Uzbekistan"]
     
    If it returns extra characters like ""Armenia"", you can add next a Compose action card with a similar expression like this: 
           

     

     

    replace(replace(replace(body('Create_CSV_table'),'[',''),']',''),'""','')

     

     

     
    Please let me know if this solves your issue.
     
    Best Regards,
    Ademar Urbano
    Power Platform Support Engineer
  • Anton_Sysoev Profile Picture
    19 on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    Hi @Ademar.

    Thanks for your reply.

    Unfortunately, it doesn't work.

    I try to put expression, but the expression is invalid.

    Screenshot_3.png

     

    Can help to correct the expression to work properly?

    Thanks,

    Anton.

  • AdemarUrbano Profile Picture
    on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    Hi @Anton_Sysoev,

     

    Sometimes it doesn't accept right away a "copy-paste" expression. Verify if the quotes or double quotes are correct or the character was changed with the copy-paste.

     

    If nothing its wrong ... insist a bit! 🙂 set the expression and press enter, or just set a normal one then change and update. 

     

    The only thing that should be necessary to change its the field name, where I already put "Region", verify if this is the correct, easy way to be sure about the field name that you need to use if to see on the get items output. 

     

    Please let me know if it worked,

     

    Best regards,

    Ademar Urbano

    Power Platform Support Engineer 

     

     

     

     

  • Anton_Sysoev Profile Picture
    19 on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    This is magic! It works!
    Many thanks @Ademar!
    I would never do it myself without your help!

    Best regards, Anton Sysoev.

  • MattPMoS Profile Picture
    11 on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    @Ademarthanks for this solution--I had to modify the Replacex3 expression in an unexpected way--the first time I tried it the brackets were gone but the " stubbornly remained. Didn't matter if it was a single one or pair in the expression. Finally I looked at the raw outputs of the previous step and saw that the quotes were being represented in html: "

    When I replaced the " with %quot; in the expression it worked perfectly.

  • zerocool55 Profile Picture
    94 on at
    Re: Create HTML table from Sharepoint List with multi-selection choose

    Hi Ademar,

    your code worked for me but I'm wondering if we can optimise it a lit bit further. I' would love to ca pture the values without the two brackets?

     

    thank you, in advance, for your support. 

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard