Hi @Anonymous,
Below is another example. It is based on the samples shared earlier.
The flow setup.
1. The Get File (properties only) action uses the Filter Query to search for the words from the Chatbot in the FileLeafRef property (the file name). It also uses a top 5 count, to only retrieve a maximum of 5 items.
substringof( '@{triggerBody()['text']}',FileLeafRef)
2. The Select is used to only retrieve specific details of the files, in this case Created on and File Name and Link to Item. Below is what I used in the example for the Map field.
{
"Created": @{formatdatetime(item()['Created'], 'dd MMM yyyy')},
"Link": "[@{item()?['{FilenameWithExtension}']}](@{item()?['{Link}']})"
}
3. A HTML table is temporary created via a HTML table action
4. The outputs is converted into a Results variable and uses a Markdown table as value, which is created with several replace functions via one expression:
replace(replace(replace(replace(replace(replace(replace(body('Create_HTML_table'), '<table><thead><tr><th>', '| '), '</th></tr></thead><tbody>', concat(' |',decodeUriComponent('%0A%0D'),'|-----------|:-----------:|',decodeUriComponent('%0A%0D'))), '</th><th>', ' | '), '<tr><td>', '| '), '</td><td>', ' | '), '</td></tr>', concat(' |',decodeUriComponent('%0A%0D'))), '</tbody></table>', '')
Btw, if you don't feel comfortable with this type expression feel free to use the apply to each with append to variable approach instead, I have a blog about that: https://powerusers.microsoft.com/t5/Power-Virtual-Agents-Community/How-to-use-mark-down-to-format-a-table-for-the-bot-response/ba-p/1190942

For completion, this is the setup of the Topic of the bot
