|
|
|
|
Initialize variable Today
|
formatDateTime(utcNow(),'yyyy-MM-dd')
|
|
|
https://www.who.int/rss-feeds/news-english.xml
|
|
|
Repeat for all items in RSS Feed
|
|
Condition if RSS feed item published today
|
indexOf(items('Apply_to_each')?['publishDate'],variables('Today'))
|
|
|
|
Compose JSON compatible file content (replacing " with \\\" because it breaks json)
|
replace(uriComponent(items('Apply_to_each')?['summary']), '%22', '%5C%5C%5C%22')
|
|
Compose removed new lines (removing new lines)
|
uriComponentToString(replace(replace(outputs('Compose_JSON_compatible_file_content'), '%0D%0A', ''), '%0A', ''))
|
|
Send an HTTP request to create file
|
_api/web/getfilebyserverrelativeurl('/sites/WHONews/SitePages/WHOTemplate.aspx')/copyto(strnewurl='/sites/WHONews/SitePages/@{items('Apply_to_each')?['title']}.aspx',bOverwrite=true)
|
|
Get file metadata of newly created file
|
SitePages%2f @{items('Apply_to_each')?['title']}.aspx
|
|
Send an HTTP request to checkout newly created file
|
_api/SitePages/pages(@{outputs('Get_file_metadata_of_newly_created_file')?['body/ItemId']})/checkoutpage
"content-type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose"
|
|
Send an HTTP request to SharePoint to add RSS feed content to file
|
_api/SitePages/pages(@{body('Get_file_metadata_of_newly_created_file')?['ItemId']})/SavePageAsDraft
"content-type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose"
Put meta data and replace the content where you need dynamic content please see screenshot
|
|
Send an HTTP request to SharePoint for publish newly created file
|
_api/SitePages/pages(@{body('Get_file_metadata_of_newly_created_file')?['ItemId']})/Publish
"content-type": "application/json;odata=verbose",
"Accept": "application/json;odata=verbose"
|