Hi,
I'm developing a power automate flow to read regularly a RSS feed, filter it for a keyword, and published it when different from 0 in a MS Teams Channel message (well, succession of messages with an "apply to each" action). I can implement this without any major problems, although the RSS feed as several problems, one of them being it presents no date/time stamp on its items (go figure...).
The summary item of the RSS Feed is HTML code. Sometimes (not often) there is in between of this html code a relative hyperlink in it that is essential to grasp. Because it points to additional relevant info. Other links that point to the item of the Feed are absolutes links. And the relative doesn't work for the users.
After the "Array Filter" action, I have to replace partial text on all the filtered "Summary Items" on it that have a relative link. However, as you all know better than me, the "replace()" works with strings only.
Relative link: 'href='/web'
Absolute link: 'href='https://website.com/web'/...
The replacing part of the absolute link for the relative is easy to attain with something like:
replace(string(body('Array_Filtered')),'href=''/web','href=''https://website.com/web') using the duplicate apostrophes instead of one to account for the apostrophe ' inside the replacement text string (being that it is a special character in power automate that encloses pretry much everything). Not Double quote ", it's 2 consecutive apostrophes ' ' (here with a space in between that shouldn't exist just for show).
The issue here is where and how do I use this...
I've tried to do it in the MS Teams create messenger action, within the existent "apply to each", that publishes a message invoking 3 items in the Filtered RSS Feed Array, to no avail... I could not transform within the HTML box of the message MS Teams action the summary item with a replacement expression.
I've tried to do it placing after the filtering an "Apply to Each" action for the Filtered Array result with a "compose" action but what I get is a string or a "Current item" that I cannot input to the "Apply to Each" for publishing the MS Teams messages. If I select the Summary Item of the Array I get automatically an enclosed succession of "Apply to Each" hat returns the same input & validity (string no array) errors .
How can I get to write back to the array the replaced item text and get this transformed array as an input for the next step? Only by initializing an array as a variable? But how can I update it with the replaced one?
Thanks in advance for any help...