Hi All!
I want to build an HTML table from a Sharepoint list and then paste it into an email.
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']
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"}]
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": 🙄
Solved! Go to Solution.
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()')
replace(replace(replace(body('Create_CSV_table'),'[',''),']',''),'""','')
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()')
replace(replace(replace(body('Create_CSV_table'),'[',''),']',''),'""','')
Hi @Ademar.
Thanks for your reply.
Unfortunately, it doesn't work.
I try to put expression, but the expression is invalid.
Can help to correct the expression to work properly?
Thanks,
Anton.
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
This is magic! It works!
Many thanks @Ademar!
I would never do it myself without your help!
Best regards, Anton Sysoev.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!
User | Count |
---|---|
44 | |
44 | |
37 | |
33 | |
27 |
User | Count |
---|---|
47 | |
38 | |
32 | |
31 | |
30 |