cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Reply
MJB_PT
Frequent Visitor

RSS filtered Array item replace

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...

5 REPLIES 5

Hi @MJB_PT 

 

Could you take a screenshot of your detailed flow with private information covered up?

 

Because I need more info to make a test and find a place to input the expression.

 

If you only want to update an array variable each time in ā€˜Apply to eachā€™.

You can try to use ā€˜Set variableā€™:

3.3-16.PNG

The action ā€˜initialize variableā€™ can only be used at top level, not nested level.

Itā€™s quite important to know the difference between ā€˜Set variableā€™ and ā€˜append to array variableā€™ when they are used in ā€˜Apply to eachā€™:

ā€˜Set variableā€™ will refresh the variable each time in a loop, which means it will erase the previously existed content in it.

ā€˜Append to array variableā€™ will retain the previously existed content in it and add new content in it each time in a loop.

 

Best Regards,
Community Support Team _ Kira Xie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yiwenxie-msft ,

Thanks for your inputs.

Here it is (sorry in advance for any misused terms/expressions below... I am not a code developer since training, more than 30 years ago; So, bear with me... this is one of a few moonlight ongoing work projects to ease team work):

MJB_PT_0-1614777400960.png

MJB_PT_1-1614777476520.png

MJB_PT_2-1614777596876.png

RSS Feed  array items (data/time ones are blanks and auto initialized by the RSS Feed list as 0 or their equivalent initial value)

MJB_PT_3-1614777624760.png

MJB_PT_4-1614777663343.png

MJB_PT_5-1614777713860.png

The above is is not working yet. I need to use in the flow the filtered keyword twice, so initialized it to be used and changed accordingly. In the following filter it should be invoked as a string variable contained in the 'summary' item instead of the direct string input "Regional". It doesn't work. I need also to address CAPS variations, i.e. "regional" or even adding more expressions [or()] , although I have to invoke that list into message subject later on.

MJB_PT_6-1614777851287.png

 

MJB_PT_7-1614779727612.png


replace(string(body('Filter_array_RSS_')),'href=''/web','href=''https://site.com/web')
Obviously this doesn't work because you can't set an array variable with a string...

How can I read the 'summary' item of this array variable, change by replacing part a string variable?

Do I have to build the array from the ground up for all its items?

Then forward:

MJB_PT_8-1614780342795.png

length(body('Filter_array_RSS_'))

MJB_PT_9-1614780487780.png

Also, I can't see the set up array variable items in order to invoked them in the MS Teams publish message action. It automatically produces a nested "Apply to each" and I can only invoke items from the filtered array result and not the current variable.

Additionally, it would also be great to add a new item to the Filtered Array object variable. The last 9 characters of the Primary link (a link to a PDF), i.e. "ABCDEF123" could be used to build another link to a permanent HTML direct page with a lot more info on the item (https://site.com/web/[set of fixed names 1]/ABCDEF123/[set fixed names 2]).
Then I could use this new item "primary_permanent_web_link" to publish both links in the message on the teams channel.

Next evolution: keep a sharepoint list(s) of all the RSS Feed filtered data extracted to maintain an archive and to account a solution for the missing date/time stamp. The feed is reset to zero ID feeds at 00h each day, first publication near 8AM, and sometimes randomly updated 1 or more times during the day. But always adding a few new entries, although it retains all the previous ones in the same ID order (i.e, ID=1 to n, 1st alteration ID=1 to n+k [n+1 to n+k being the new entries], 2nd alteration ID=1 to n+k+m [n+k+1 to n+k+m being the new entries], etc...  if more daily alterations of the feed exists]. Weekends and holiday are always zero ID feeds, but eventually some new feeds could be published in these days.


Thanks again in advance!

MJB_PT
Frequent Visitor

Anyone could help? Tried a lot of things to no avail... šŸ˜ž

manuelstgomes
Community Champion
Community Champion

HI @MJB_PT 

 

I would do the following:

  1. Parse each element and transform the relative URL into absolute.
  2. Append each element into a string variable that will be used to send the information to Microsoft Teams
  3. Post to teams.

 

Here's the full Flow:

Screenshot 2021-03-10 at 09.09.36.png

 

The formulas are as follows:

 

replace(item(),'href=''/','https://www.site.org/')

 

Using this strategy you're always sure that, regardless of what is the relative path is always added to the end.

 

Build the line

 

<li>Text <a href="@{outputs('Compose')}">Link Text</a></li>

 

 

Can you please check if and let me know if you have any questions?

 

Cheers
Manuel

-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Many thanks @manuelstgomes !!

Just send you another message with some iterations on the adaptation I've done. (sorry everyone seeing this, but it to large to post here; However, I'm committed to publish the solution and the critical pathways in the end)

Still not getting the replacement  of the "summary" string component  within the Array variable. This is a string with HTML content on it.

As a requirement, I need to further publish all the replaced & not replaced value items in the "summary" component  of the array.

I need to perform partial replacement within the full string value of this component which is within the array.
Data is within the array, but I a) cannot get it and/or replace the partial string on it b) and get the full string value with the replacement bit to the "summary" component again  for all the items replaced.

This is so frustrating. It should be a simple data operation in whatever array structure that exists. One should be able to get the structure of the array and point to the desired component within the array one wants to update (append/set/etc.). A cascade of apply to each doesn't seems to solve this without appending an index as a new component to the array and  indexing one-by-one all the entries in the Array (which are dynamic, not fixed) to point to it?... an humongous complexity...

Sigh...




Helpful resources

Announcements

Tuesday Tip: Getting Started with Private Messages & Macros

Welcome toĀ TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether youā€™re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community. Ā  As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure youā€™re well-versed in the communityā€™s pulse. Keep an eye on the News & Announcements for your weeklyĀ Tuesday Tipsā€”you never know what you may learn! Ā  This Week's Tip: Private Messaging & Macros in Power Apps Community Ā  Do you want to enhance your communication in the Community and streamline your interactions? One of the best ways to do this is to ensure you are using Private Messaging--and the ever-handy macros that are available to you as a Community member! Ā  Our Knowledge Base article about private messaging and macros is the best place to find out more. Check it out today and discover some key tips and tricks when it comes to messages and macros: Ā  Private Messaging: Learn how toĀ enable private messagesĀ in your community profile and ensure youā€™re connected with other community membersMacros Explained: Discover the convenience ofĀ macrosā€”prewritten text snippets that save time when posting in forums or sending private messagesCreating Macros: Follow simple steps toĀ create your own macrosĀ for efficient communication within the Power Apps CommunityUsage Guide:Ā Understand how toĀ apply macrosĀ in posts and private messages, enhancing your interaction with the Community For detailed instructions and more information, visit the full page in your community today:Power Apps:Ā Enabling Private Messaging & How to Use Macros (Power Apps)Power Automate:Ā Enabling Private Messaging & How to Use Macros (Power Automate)Ā  Copilot Studio:Ā Enabling Private Messaging &How to Use Macros (Copilot Studio)Ā Power Pages:Ā Enabling Private Messaging & How to Use Macros (Power Pages)

Tuesday Tip: Subscriptions & Notifications

TUESDAY TIPSĀ are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users. Ā  With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips! Ā  This Week: All About Subscriptions & Notifications We don't want you to a miss a thing in the Community! The best way to make sure you know what's going on in the News & Announcements, to blogs you follow, or forums and galleries you're interested in is to subscribe! TheseĀ subscriptionsĀ ensure you receive automated messages about the most recent posts and replies. Even better, there are multiple ways you can subscribe to content and boards in the community! (Please note:Ā if you have created an AADĀ (Azure Active Directory)Ā accountĀ you won't be able to receive e-mail notifications.) Ā  Subscribing to a CategoryĀ  When you're looking at the entire category, select from the Options drop down and choose Subscribe. Ā  Ā  You can then choose to Subscribe to all of the boards or select only the boards you want to receive notifications. When you're satisfiedĀ with your choices, click Save. Ā  Ā  Subscribing to a Topic You can also subscribe to a single topic by clicking SubscribeĀ from the Options drop down menu, while you are viewing the topic or in the General board overview, respectively. Ā  Ā  Subscribing to a Label Find the labels at the bottom left of a post.From a particular post with a label, click on the label to filter by that label.Ā This opens a window containing a list of posts with the label you have selected. Click Subscribe. Ā  Ā  Note:Ā You can only subscribe to a label at the board level. If you subscribe to a label named 'Copilot' at board #1, it will not automatically subscribe you to an identically named label at board #2. You will have to subscribe twice, once at each board. Ā  Bookmarks Just like you can subscribe to topics and categories, you can also bookmark topics and boards from the same menus! Simply go to the Topic Options drop down menu to bookmark a topic or the Options drop down to bookmark a board. The difference between subscribing and bookmarking is thatĀ subscriptionsĀ provide you with notifications, whereasĀ bookmarksĀ provide you a static way of easily accessing your favorite boards from theĀ My subscriptionsĀ area. Ā  Managing & Viewing Your Subscriptions & Bookmarks To manage your subscriptions, click on your avatar and select My subscriptions from the drop-down menu. Ā  Ā  From the Subscriptions & Notifications tab, you can manage your subscriptions, including your e-mail subscription options, your bookmarks, your notification settings, and your email notification format. Ā  Ā  You can see a list of all your subscriptions and bookmarks and choose which ones to delete, either individually or in bulk, by checking multiple boxes. Ā  Ā  A Note on Following Friends on Mobile Adding someone as a friend or selecting Follow in the mobile view does not allow you to subscribe to their activity feed.Ā You will merely be able to see your friendsā€™ biography, other personal information, or online status, and send messages more quickly by choosing who to send the message to from a list, as opposed to having to search by username.

Monthly Community User Group Update | April 2024

The monthlyĀ CommunityĀ User Group UpdateĀ is your resource for discovering User Group meetings and events happening around the world (and virtually), welcoming new User Groups to our Community, and more! Our amazing Community User Groups are an important part of the Power Platform Community, with more than 700 Community User Groups worldwide, we know they're a great way to engage personally, while giving our members a place to learn and grow together. Ā  This month, we welcomeĀ 3 new User GroupsĀ in India, Wales, and Germany, and featureĀ 8Ā User Group EventsĀ across Power Platform and Dynamics 365. Find out more below. New Power Platform User Groups Ā  Power Platform Innovators (India) About: Our aim is to foster a collaborative environment where we can share upcoming Power Platform events, best practices, and valuable content related to Power Platform. Whether youā€™re a seasoned expert or a newcomer looking to learn, this group is for you. Letā€™s empower each other to achieve more with Power Platform. Join us in shaping the future of digital transformation! Ā  Power Platform User Group (Wales) About: A Power Platform User Group in Wales (predominantly based in Cardiff but will look to hold sessions around Wales) to establish a community to share learnings and experience in all parts of the platform. Ā  Power Platform User Group (Hannover) About:Ā This group is for anyone who works with the services of Microsoft Power Platform or wants to learn more about it and no-code/low-code. And, of course, Microsoft Copilot application in the Power Platform. Ā  New Dynamics365 User Groups Ā  Ellucian CRM Recruit UK (United Kingdom) About:Ā A group for United Kingdom universities using Ellucian CRM Recruit to manage their admissions process, to share good practice and resolve issues.Ā  Ā  Business Central Mexico (Mexico City) About:Ā  A place to find documentation, learning resources, and events focused on user needs in Mexico. We meet to discuss and answer questions about the current features in the standard localization that Microsoft provides, and what you only find in third-party locations. In addition, we focus on what's planned for new standard versions, recent legislation requirements, and more.Ā Let's work together to drive request votes for Microsoft for features that aren't currently foundā€”but are indispensable. Ā  Dynamics 365 F&O User Group (Dublin) About: The Dynamics 365 F&O User Group - Ireland Chapter meets up in person at least twice yearly in One Microsoft Place Dublin for users to have the opportunity to have conversations on mutual topics, find out whatā€™s new and on the Dynamics 365 FinOps Product Roadmap, get insights from customer and partner experiences, and access to Microsoft subject matter expertise.Ā  Upcoming Power Platform EventsĀ  Ā  PAK Time (Power Apps Kwentuhan) 2024 #6 (Phillipines, Online)Ā This is a continuation session of Custom API. Sir Jun Miano will be sharing firsthand experience on setting up custom API and best practices. (April 6, 2024) Ā  Ā  Ā  Power Apps: Creating business applications rapidly (Sydney)Ā At this event, learn how to choose the right app on Power Platform, creating a business application in an hour, and tips for using Copilot AI. While we recommend attending all 6 events in the series, each session is independent of one another, and you can join the topics of your interest. Think of it as a ā€œHop On, Hop Offā€ bus! Participation is free, but you need a personal computer (laptop) and we provide the rest. We look forward to seeing you there! (April 11, 2024) Ā  Ā  April 2024 Cleveland Power Platform User Group (Independence, Ohio)Ā Kickoff the meeting with networking, and then our speaker will share how to create responsive and intuitive Canvas Apps using features like Variables, Search and Filtering. And how PowerFx rich functions and expressions makes configuring those functionalities easier. Bring ideas to discuss and engage with other community members! (April 16, 2024) Ā  Ā  Dynamics 365 and Power Platform 2024 Wave 1 Release (NYC, Online)Ā This session features Aric Levin, Microsoft Business Applications MVP and Technical Architect at Avanade and Mihir Shah, Global CoC Leader of Microsoft Managed Services at IBM. We will cover some of the new features and enhancements related to the Power Platform, Dataverse, Maker Portal, Unified Interface and the Microsoft First Party Apps (Microsoft Dynamics 365) that were announced in the Microsoft Dynamics 365 and Power Platform 2024 Release Wave 1 Plan. (April 17, 2024) Ā  Ā  Letā€™s Explore Copilot Studio Series: Bot Skills to Extend Your Copilots (Makati National Capital Reg...Ā Join us for the second installment of ourĀ Let's Explore Copilot Studio Series, focusing on Bot Skills. Learn how to enhance your copilot's abilities to automate tasks within specific topics, from booking appointments to sending emails and managing tasks. Discover the power of Skills in expanding conversational capabilities. (April 30, 2024) Ā  Upcoming Dynamics365 EventsĀ  Ā  Leveraging Customer Managed Keys (CMK) in Dynamics 365 (Noida, Uttar Pradesh, Online)Ā This month's featured topic: Leveraging Customer Managed Keys (CMK) in Dynamics 365, with special guestĀ Nitin JainĀ fromĀ Microsoft. We are excited and thankful to him for doing this session. Join us for this online session, which should be helpful toĀ all Dynamics 365 developers, Technical Architects and Enterprise architects who are implementing Dynamics 365 and want to have more control on the security of their data over Microsoft Managed Keys. (April 11, 2024) Ā  Ā  Ā  Stockholm D365 User Group April Meeting (Stockholm) This is a Swedish user group for D365 Finance and Operations, AX2012, CRM, CE, Project Operations, and Power BI.Ā  (April 17, 2024) Ā  Ā  Ā  Ā  Transportation Management in D365 F&SCM Q&A Session (Toronto, Online)Ā Calling all Toronto UG members and beyond!Ā Join us for an engaging and informative one-hour Q&A session, exclusively focused on Transportation Management System (TMS) within Dynamics 365 F&SCM. Whether youā€™re a seasoned professional or just curious about TMS, this event is for you.Ā Bring your questions! (April 26, 2024) Ā  Leaders, Create Your Events!Ā  Ā  Leaders of existing User Groups, donā€™t forget to create your events within the Community platform. By doing so, youā€™ll enable us to share them in future posts and newsletters. Letā€™s spread the word and make these gatherings even more impactful! Stay tuned for more updates, inspiring stories, and collaborative opportunities from and for our Community User Groups. Ā  P.S. Have an event or success story to share? Reach out to us ā€“ weā€™d love to feature you. Just leave a comment or send a PM here in the Community!

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

We have closed kudos on this post at this time. Thank you to everyone who kudo'ed their RSVP--your invitations are coming soon!Ā  MissĀ the window to RSVP? Don't worry--you can catch the recording of the meeting this week in the Community.Ā  Details coming soon! Ā  ***** Ā  It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT). Ā  Ā  This is an incredible opportunity to connect with members of the Copilot Studio product team andĀ ask them anythingĀ about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendarsĀ nowĀ because you will not want to miss the conversation. Ā  This live event will give you theĀ unique opportunity to learn more about Copilot Studio plans, where weā€™ll focus, and get insight into upcoming features. Weā€™re looking forward to hearing from the community, so bring your questions! Ā  TO GET ACCESS TO THIS EXCLUSIVE AMA:Ā Kudo this post to reserve your spot!Ā Reserve your spot now byĀ kudoing this post.Ā  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today. Ā  Invitations will be sent on April 2nd.Users posting KudosĀ afterĀ April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendarsĀ for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Blogging in the Community is a Great Way to Start

TUESDAY TIPSĀ are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users. Ā  With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips! Ā  This Week's Topic: Blogging in the Community Are you new to our Communities and feel like you may know a few things to share, but you're not quite ready to start answering questions in the forums? A great place to start is the Community blog! Whether you've been using Power Platform for awhile, or you're new to the low-code revolution, the Community blog is a place for anyone who can write, has some great insight to share, and is willing to commit to posting regularly! In other words, we want YOU to join the Community blog.Ā  Ā  Why should you consider becoming a blog author?Ā Here are just a few great reasons.Ā 🎉 Ā  Learn from Each Other: Our community is like a bustling marketplace of ideas. By sharing your experiences and insights, you contribute to a dynamic ecosystem where makers learn from one another. Your unique perspective matters! Collaborate and Innovate: Imagine a virtual brainstorming session where minds collide, ideas spark, and solutions emerge. Thatā€™s what our community blog offersā€”a platform for collaboration and innovation. Together, we can build something extraordinary. Showcase the Power of Low-Code: You know that feeling when you discover a hidden gem? By writing about your experience with your favorite Power Platform tool, youā€™re shining a spotlight on its capabilities and real-world applications. Itā€™s like saying, ā€œHey world, check out this amazing tool!ā€ Earn Trust and Credibility: When you share valuable information, you become a trusted resource. Your fellow community members rely on your tips, tricks, and know-how. Itā€™s like being the go-to friend who always has the best recommendations. Empower Others: By contributing to our community blog, you empower others to level up their skills. Whether itā€™s a nifty workaround, a time-saving hack, or an aha moment, your words have impact. So grab your keyboard, brew your favorite beverage, and start writing! Your insights matter and your voice counts! With every blog shared in the Community, we all do a better job of tackling complex challenges with gusto.Ā 🚀 Welcome aboard, future blog author!Ā āœļø💻🌟Ā Get started blogging across the Power Platform Communities today! Just follow one of the links below to begin your blogging adventure. Ā  Power Apps:Ā https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/bg-p/PowerAppsBlog Power Automate:Ā https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/bg-p/MPABlog Copilot Studio:Ā https://powerusers.microsoft.com/t5/Copilot-Studio-Community-Blog/bg-p/PVACommunityBlog Power Pages:Ā https://powerusers.microsoft.com/t5/Power-Pages-Community-Blog/bg-p/mpp_blog Ā  When you follow the link, look for the Message Admins button like this on the page's right rail, and let us know you're interested. We can't wait to connect with you and help you get started. Thanks for being part of our incredible community--and thanks for becoming part of the community blog!

Launch Event Registration: Redefine What's Possible Using AI

Ā  Join Microsoft product leaders and engineers for an in-depth look at the latest features in Microsoft Dynamics 365 and Microsoft Power Platform. Learn how advances in AI and Microsoft Copilot can help you connect teams, processes, and data, and respond to changing business needs with greater agility. Weā€™ll share insights and demonstrate how 2024 release wave 1 updates and advancements will help you: Ā  Streamline business processes, automate repetitive tasks, and unlock creativityĀ using the power of Copilot and role-specific insights and actions. Unify customer dataā€Æto optimize customer journeys with generative AI and foster collaboration between sales and marketing teams. Strengthen governanceĀ with upgraded tools and features. Accelerate low-code developmentĀ ā€Æusing natural language and streamlined tools. Plus, you can get answers to your questions during our live Q&A chat! Don't wait--register today by clicking the image below! Ā  Ā  Ā 

Users online (6,263)