I would like to use power automate to send a post an automated trending culinary…
- User
I would like to use power automate to send a post an automated trending culinary articles post to my teams channel every monday morning, is this somthing you can help me with
- Assistant
Yes, I can definitely help you set up a Power Automate flow to post an automated message with trending culinary articles to your Microsoft Teams channel every Monday morning. Here's a high-level overview of the steps involved and an example approach:
What You Need:
-
Source for trending culinary articles:
- An RSS feed from a culinary news website or blog
- Or an API endpoint that provides trending articles (if available)
- Or a curated list you maintain somewhere (SharePoint, Excel, etc.)
-
Microsoft Power Automate: To create the flow
-
Access to the Microsoft Teams channel where the posts will be sent
Step-by-step guide:
Step 1: Identify your content source
- Option A: Use an RSS feed
Many food websites and culinary news blogs provide RSS feeds with their latest articles. For example, Food Network, Serious Eats, or popular food blogs. - Option B: Use an API
If you have access to a 3rd party API (like NewsAPI) filtering for culinary content, you can use that. - Option C: Curated Content
Maintain a list of trending articles manually updated in SharePoint, Excel Online, or OneDrive.
Step 2: Create a scheduled flow in Power Automate
- Go to Power Automate and create a new Scheduled cloud flow
- Set it to run weekly, every Monday morning at your desired time (e.g., 8:00 AM)
Step 3: Get the trending culinary articles
- If using RSS: use the built-in RSS – Get RSS feed items trigger or action to retrieve the latest items
- If using API: use HTTP action to call your API and parse the response
- If using files (Excel, SharePoint): use respective connectors to read the article list
Step 4: Format the content for Teams message
- Use Compose or HTML/Text formatting to build the message body including article titles and links
- You can format it nicely using Markdown or adaptive cards for better presentation
Step 5: Post the message to Teams channel
- Use the Microsoft Teams - Post a message (V3) action
- Select the Team and Channel to post the message
- Insert the formatted content into the message body
Example: Simple flow using RSS feed
- Trigger: Recurrence - Weekly, Monday, 8:00 AM
- Action: RSS - Get RSS feed items
- Feed URL: The URL of your culinary articles RSS feed
- Action: Initialize a String variable to hold message content
- Action: Apply to each (RSS feed items)
- Append article title + article link to the variable
- Action: Microsoft Teams - Post message in channel
- Team: Your Team
- Channel: Your Channel
- Message: variable content
Additional Tips:
- You can filter the articles if the feed is too broad or contains unrelated content
- Use Adaptive Cards for richer formatting (requires more setup)
- Test your flow with sample data before scheduling it fully
- Consider error handling for missing or null data
If you want, I can help you build the exact flow with your specific article source and Teams setup. Just share more details about where you want to pull the culinary articles from or which RSS feed/api you want to use.
-
- User
Can you do this for me and show me how to impliment
- Assistant
Absolutely! I'll guide you through building a Power Automate flow that fetches trending culinary articles from an RSS feed and posts them to a Microsoft Teams channel every Monday morning.
What we will build:
- A scheduled flow running every Monday at 8:00 AM
- It fetches the latest culinary articles from an RSS feed
- It formats the titles and links into a message
- It posts the message to your chosen Teams channel
Step 1: Choose an RSS Feed for Trending Culinary Articles
For example, here are some example RSS feeds you could use:
- Serious Eats: https://www.seriouseats.com/rss
- Food Network News: https://www.foodnetwork.com/news/rss
- Epicurious: https://www.epicurious.com/services/rss
(You can replace with any culinary RSS feed you prefer.)
Step 2: Creating the Flow in Power Automate
1. Sign in to Power Automate
2. Create a Scheduled cloud flow:
- Click Create > Scheduled cloud flow
- Flow name:
Weekly Culinary Articles to Teams - Set start time (e.g., next Monday at 8:00 AM)
- Repeat every: 1 week
- Click Create
3. Add the RSS - Get RSS feed items action:
- Search for “RSS” and select RSS - Get RSS feed items
- Enter your chosen RSS feed URL (e.g., https://www.seriouseats.com/rss)
- By default, this action gets the latest 10 items
4. Initialize a variable to build the message:
- Click + New step
- Search Initialize variable
- Name:
MessageContent - Type: String
- Value: Leave blank for now
5. Loop through the RSS feed items to build the message:
- Add Apply to each action
- Select the value from RSS action (
valueoritems) as input - Inside the loop, add Append to string variable:
- Name:
MessageContent - Value: (You can add the article title and link in markdown format for hyperlinks)
- [@{items('Apply_to_each')?['title']}]( @{items('Apply_to_each')?['link']} ) - Also consider adding a line break at the end:
\n
- Name:
Note: In Power Automate, to add line breaks inside strings, you can use
<br>for HTML or add two new lines in markdown. Teams supports basic markdown in channel messages.A simpler expression inside the Append step could be:
- [Title](Link)<br>Which translates to:
- [@{items('Apply_to_each')?['title']}]( @{items('Apply_to_each')?['link']} )<br>Make sure to remove any spaces after bracket to keep links correct.
Alternative approach for line breaks is to use:
concat('- [', items('Apply_to_each')?['title'], '](', items('Apply_to_each')?['link'], ')', '\n')So the Append to string variable's Value field can be:
concat('- [', items('Apply_to_each')?['title'], '](', items('Apply_to_each')?['link'], ')', '\n')
6. Post the final message to your Teams channel:
- Add Microsoft Teams - Post a message in a chat or channel action
- Team: Select your team
- Channel: Select your channel
- Message:
Here are the trending culinary articles for this week: @{variables('MessageContent')}
(You can also add some static text to introduce the message.)
Step 3: Save and Test Your Flow
- Save the flow
- You can run the flow manually to test, even if it's scheduled
- Verify the message appears in your Teams channel with article titles and clickable links
Summary
Your flow will:
- Trigger every Monday at 8:00 AM
- Fetch the latest culinary articles from the RSS feed
- Format the titles and URLs as a markdown list
- Post the formatted list to your selected Teams channel
Additional Help
If you want, I can provide you with exact JSON or the full export of the flow or help with Adaptive Cards formatting for nicer look. Let me know!
Screenshots / Visual Help
If you want, I can describe each Power Automate screen with step-by-step visuals or link you to a tutorial.
Would you like me to:
- Provide an export file (.zip) of this flow you can import directly?
- Or walk you through detailed screenshots and instructions of each step in Power Automate's interface?
- Or help you customize with a specific RSS feed you have in mind?
Let me know!
- User
using this rss : https://www.foodbusinessnews.net/rss/articles
- Assistant
Great! I will tailor the instructions specifically for the RSS feed you provided:
https://www.foodbusinessnews.net/rss/articles
Step-by-step guide to build your Power Automate flow
Step 1: Sign in and create scheduled flow
-
Go to powerautomate.microsoft.com and sign in.
-
On the left sidebar, click Create > Scheduled cloud flow.
-
Enter a flow name, e.g.,
Weekly Food Business Articles to Teams. -
Set the Start date and time to the coming Monday (e.g., 8:00 AM).
-
Set Repeat every to
1week. -
Click Create.
Step 2: Add action to get RSS feed items
-
Click + New step.
-
Search for RSS and pick RSS - Get RSS feed items.
-
In the Feed URL box, paste:
https://www.foodbusinessnews.net/rss/articles -
This will fetch the top 10 latest articles from this feed.
Step 3: Initialize a string variable
MessageContent-
Click + New step.
-
Search Initialize variable.
-
Define:
- Name:
MessageContent - Type: String
- Value: Leave empty (blank)
- Name:
Step 4: Append each article title and link to the variable
-
Click + New step.
-
Search and select Apply to each.
-
In the Select an output from previous steps field, choose the
valuedynamic content from Get RSS feed items step. -
Inside this loop, click Add an action.
-
Search Append to string variable.
-
Choose the
MessageContentvariable. -
In the Value field, use this expression to add markdown formatted links with line breaks:
concat('- [', items('Apply_to_each')?['title'], '](', items('Apply_to_each')?['link'], ')', '\n')How to enter this expression:
- Click inside the Value box.
- Select Expression tab.
- Paste the expression above.
- Click OK.
Step 5: Post the compiled message to Teams channel
-
Click + New step.
-
Search and select Microsoft Teams - Post a message (V3).
-
Configure:
- Team: Select your Team from the dropdown
- Channel: Select the channel where you want the post to appear
- Message: Enter this, mixing static text with the variable:
Here are the trending food business articles for this week: @{variables('MessageContent')}
Step 6: Save and test the flow
-
Click Save.
-
To test immediately, click Test at top right > Manually > Run flow.
-
Verify that the message appears in the chosen Teams channel with clickable article links.
That's it! Your flow will now run every Monday morning and post the latest articles from Food Business News to Teams.
Optional improvements
- Limit articles posted: Add a condition inside the loop, for example only first 5 articles
- Adaptive Cards: For prettier message presentation
- Error handling: Add steps if RSS feed is empty or fails
If you want, I can create a JSON export of this flow that you can import directly into your Power Automate environment. Would you like me to do that?
-
- User
when saving i got this error, can you help : Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The repetition action(s) 'Apply_to_each' referenced by 'inputs' in action 'Append_to_string_variable' are not defined in the template.'.'.
- Assistant
That error usually happens when the
Append to string variableaction refers to theApply to eachloop in the expression, but the flow designer hasn’t recognized the correct scope or the naming is mismatched.Let me help you fix this step-by-step.
Root cause:
In your Append to string variable action's expression, you likely wrote:
concat('- [', items('Apply_to_each')?['title'], '](', items('Apply_to_each')?['link'], ')', '\n')But the actual Apply to each action's name in your flow may differ, or the expression is used outside the loop, causing an invalid reference.
How to fix it:
Option 1: Use the dynamic content directly inside the loop (recommended)
-
In the Apply to each loop, when you add Append to string variable, do NOT type or copy-paste the expression manually into the value box.
-
Instead:
-
Click inside Value field of the Append to string variable action.
-
Use the dynamic content picker (from the right-hand pane) to select:
-
Title (from current item)
-
Link (from current item)
-
-
-
Then build the string using the Expression editor, combining the dynamic content:
Here is how to do it step-by-step:
-
Inside the Append to string variable action, click in the Value text box.
-
Instead of typing the entire expression, start typing it carefully by mixing dynamic content and text:
Example:
- [Title](Link)
Since Power Automate doesn't let you mix text and dynamic content easily, use
concat()and insert dynamic content as parameters:-
Click Expression tab in "Value".
-
Paste this expression:
concat('- [', item() ? ['title'], '](', item() ? ['link'], ')', '\n')But
item()is the recommended way to reference current item inside 'Apply to each'.Or, even better, just use dynamic content:
concat('- [', items('Apply_to_each')?['title'], '](', items('Apply_to_each')?['link'], ')', '\n')However, the name
Apply_to_eachin the expression has to EXACTLY match the name of your loop action.
How to check the exact name of your loop:
-
In the flow designer, click on your Apply to each control.
-
On the top right of the action box, note the exact name of the action (e.g.
Apply_to_each,Apply_to_each_2, etc.). -
Use that exact name in your expression, for example:
concat('- [', items('Apply_to_each_2')?['title'], '](', items('Apply_to_each_2')?['link'], ')', '\n')
Option 2: Use
item()function (simplest inside the loop)- Instead of
items('Apply_to_each')?['title'], use:
concat('- [', item()?['title'], '](', item()?['link'], ')', '\n')Because
item()always refers to the current item inside the loop, no matter the action name.
Summary fix to your Append to string variable action:
- Inside the loop’s Append to string variable, set the value to this expression:
concat('- [', item()?['title'], '](', item()?['link'], ')', '\n')
Complete recommended workflow:
-
Scheduled trigger (once per week)
-
Get RSS feed items
-
Initialize string variable
-
Apply to each (on
valuefrom RSS):- Append to string variable with Value:
concat('- [', item()?['title'], '](', item()?['link'], ')', '\n') -
Post a message to Teams with:
Here are the trending food business articles for this week: @{variables('MessageContent')}
If you want, I can generate an export package of this exact working flow for you to import and customize easily.
Let me know if you want me to provide that or need screenshots!
-
- User
I would like to use power automate to send a post an automated trending culinary articles post from this RSS : https://cultmtl.com/feed/ to my teams channel every monday morning, is this somthing you can help me with
- Assistant
Absolutely! I can help you create a Power Automate flow that fetches the latest trending culinary articles from the RSS feed
https://cultmtl.com/feed/and posts them to your Microsoft Teams channel every Monday morning automatically.
Here's how we'll build it:
Flow summary:
- Trigger: Scheduled - every Monday morning at a specific time (e.g., 8 AM)
- Action: Get RSS feed items from the culinary articles RSS feed
- Process: Loop through feed items and build a formatted message
- Action: Post the compiled message to your Teams channel
Step-by-step Guide to Create the Flow
Step 1: Sign in and create a new Scheduled cloud flow
-
Go to Power Automate.
-
Sign in with your work or school account.
-
Click Create > Scheduled cloud flow.
-
Name your flow, e.g.,
Weekly Culinary Articles from CultMTL. -
Set the start date and time for the next Monday morning at your preferred time (e.g., 8:00 AM).
-
Set the recurrence to every
1week. -
Click Create.
Step 2: Add RSS action to get feed items
-
Click + New step.
-
Search for RSS and select Get RSS feed items.
-
Enter this RSS feed URL:
https://cultmtl.com/feed/
This will get the latest articles from CultMTL.
Step 3: Initialize a string variable to build the message content
-
Click + New step.
-
Search for Initialize variable.
-
Configure:
- Name:
MessageContent - Type: String
- Value: Leave blank
- Name:
Step 4: Loop through each RSS feed item and append formatted article info
-
Click + New step.
-
Search for Apply to each.
-
In the Select an output from previous steps, choose the
valuedynamic content from Get RSS feed items. -
Inside the Apply to each, add an Append to string variable action:
-
Name:
MessageContent -
Value: Use this expression:
concat('- [', item()?['title'], '](', item()?['link'], ')', '\n')
-
This creates a markdown link list item for each article.
Step 5: Post the message to your Teams channel
-
Click + New step.
-
Search for Microsoft Teams and select Post a message (V3).
-
Configure:
-
Team: Select your Team (where you want to post)
-
Channel: Select the channel
-
Message:
Here are this week's trending culinary articles from CultMTL: @{variables('MessageContent')}
-
Step 6: Save and test your flow
-
Click Save.
-
To test, click Test > Manually > Run flow.
-
Check your Teams channel to see if the message appears correctly.
Bonus Tips:
-
You can limit the number of articles by adding a Top Count to RSS feed action or adding conditions inside the loop.
-
You can improve formatting with Adaptive Cards if you want richer message layouts.
If you'd like, I can also provide you with an export of the flow for direct import or screenshots for each step. Just let me know!
- User
I dont have the GET RSS Feed items step i have a list all RSS feed items
- Assistant
Thanks for pointing that out!
The official RSS connector in Power Automate has an action named "List all RSS feed items", which is equivalent to "Get RSS feed items". The difference in naming can be confusing.
You should use the "List all RSS feed items" action to retrieve the articles from the feed.
Here's how you proceed with the List all RSS feed items action
-
In your flow, after your Recurrence (Scheduled) trigger, click + New step.
-
Search for RSS and choose List all RSS feed items.
-
In the Feed URL field, enter:
https://cultmtl.com/feed/ -
This action will retrieve the latest items from the feed.
-
Now, you can continue the flow exactly as before:
-
Initialize a string variable
MessageContentwith empty value. -
Add Apply to each, and pick the output from List all RSS feed items — typically select the dynamic content
value. -
Inside the loop, add Append to string variable, and in the value use this expression:
concat('- [', item()?['title'], '](', item()?['link'], ')', '\n')
-
-
After the loop, use Post a message (V3) from Microsoft Teams to send the message with:
Here are this week's trending culinary articles from CultMTL: @{variables('MessageContent')}
Summary:
-
Use List all RSS feed items instead of "Get RSS feed items".
-
The rest of the flow works the same because the output schema and dynamic content are consistent.
If you want me to provide an exact flow export file with these details using "List all RSS feed items," just ask!
-
- User
Is there somewhere that i can automatically get a Chef meme and post it to Teams through power automate
- Assistant
Yes! You can absolutely automate posting a Chef meme to your Teams channel using Power Automate. Here’s an outline of how to do it:
How to Automatically Get a Chef Meme and Post It to Teams Using Power Automate
Step 1: Find a source for Chef memes
You need a source that provides Chef-related memes in a way you can access programmatically. Options include:
- Public meme APIs: Some meme APIs provide random memes from various categories, though Chef-specific memes might be rare.
- RSS feed or social media account: If there's a Twitter account or RSS feed that posts Chef memes.
- Curated repository: A collection of Chef meme images you upload to a SharePoint folder, OneDrive, or a public image hosting site.
- Meme generator APIs: Like Imgflip API, where you can generate memes if you have templates.
Step 2: Use Power Automate to get a meme image URL or file
Here are some approaches:
Option A: Use a Meme API
- Example: Imgflip API (https://imgflip.com/api) lets you generate memes programmatically.
- You can create a meme with caption text on a Chef meme template and get the image URL from the response.
Option B: Use a curated folder
- Store chef meme images in a SharePoint document library or OneDrive folder.
- Use Power Automate to randomly select a file from this folder.
Option C: Use public meme APIs or RSS feeds
- Search for public meme APIs that offer random meme images with a category for cooking/chef memes (may be limited).
- Alternatively, find relevant subreddits (like r/CookingMemes), and use an RSS feed or API to get latest posts.
Step 3: Post the meme image to Teams channel
- Use the Microsoft Teams - Post a message (V3) action with the Image URL in the message body.
- Or you can post an adaptive card containing the image in your Teams channel for better formatting.
Sample Flow Setup Using Curated Images in OneDrive (Option B)
-
Trigger: Scheduled or Manual (your choice).
-
List files in folder: Use OneDrive or SharePoint connector to get all images in your Chef meme folder.
-
Select a random file:
- Use Compose action with an expression to generate a random index:
rand(0, length(body('List_files')?['value']))- Use Compose to get the file at that index.
-
Get file content or file URL:
- For public images, get direct links.
- For private, use file content or shareable links.
-
Post message in Teams:
- Use the Post message (V3) action and include the image link or upload the image as an attachment (this requires Adaptive Card or Teams file upload logic).
Bonus: Using Imgflip API to generate a Chef meme dynamically
-
Imgflip templates (https://imgflip.com/api) includes meme templates; if they have a chef meme template ID, you can call their API to create memes with captions.
-
You can use the HTTP action in Power Automate to call Imgflip API with parameters.
-
Then extract the generated meme URL and post it in Teams.
Summary
-
If you want something quick, the curated folder approach is often easiest. Upload your favorite chef memes to OneDrive or SharePoint, use Power Automate to pick a random image, and post it to Teams.
-
For dynamic/generative memes, integrate with meme generator APIs like Imgflip.
If you'd like, I can provide a detailed walkthrough or template flow for either option. Just let me know which approach you'd prefer!
- User
Give me the detailed flow for the onedrive action
- Assistant
Certainly! Below is a detailed step-by-step guide to create a Power Automate flow that picks a random Chef meme image from a OneDrive folder and posts it to your Microsoft Teams channel.
Power Automate Flow: Post a Random Chef Meme from OneDrive to Teams
Prerequisites
- A OneDrive folder containing Chef meme images (jpg, png, etc.).
- Access to Power Automate.
- Permission to post messages in the Teams channel where you want memes shared.
Step 1: Prepare your OneDrive folder
- Create a folder in your OneDrive (e.g.,
Chef Memes). - Upload several Chef meme images to this folder.
- (Optional) Make sure these images are accessible via a sharing link.
Step 2: Create the Flow
1. Create a Scheduled or Instant Cloud Flow
- Go to Power Automate.
- Click Create > choose either:
- Scheduled cloud flow (e.g., every Monday at 8 AM), or
- Instant cloud flow (button-triggered for manual run).
- Name your flow, e.g.,
Post Random Chef Meme to Teams.
2. List files in the OneDrive folder
- Add a new step.
- Search for and select OneDrive for Business - List files in folder.
- For Folder, select your
Chef Memesfolder path.
3. Get count of files
We need the number of images to randomly pick one.
- Add a Compose action.
- In the inputs field, enter the following expression:
length(body('List_files_in_folder')?['value'])(This counts how many files are in the folder.)
4. Generate a random index
- Add another Compose action.
- In the inputs field, enter this expression to get a random number between 0 and (fileCount - 1):
rand(0, sub(outputs('Compose'),1))Explanation:
outputs('Compose')gives the number of files.sub(outputs('Compose'),1)subtracts 1 because array indexes are zero-based.
5. Get the random file metadata
- Add the Compose action (3rd one).
- For the Inputs, enter this expression to fetch the file metadata at the random index:
body('List_files_in_folder')?['value'][outputs('Compose_2')]Make sure to replace
Compose_2with the actual name of your random index compose if you used a different step name.
6. Get the file content or link
Option A: Get a shareable link (recommended for ease of posting image URL)
-
Add the OneDrive for Business - Create sharing link action.
-
For File Path, select the Path property from the output of step 5 (random file metadata compose):
-
Click inside the File Path box.
-
Select Outputs from step 5 >
Path.
-
-
Set Link type to
View. -
Set Scope to
Anonymous(makes a publicly accessible link - optional depending on your org policy).
7. Post the meme to Teams channel
-
Add Microsoft Teams - Post a message (V3) action.
-
Configure:
-
Team: Select your Team.
-
Channel: Select the channel.
-
Message: Paste this message content:
Here's a random Chef meme for you! 🍳 ?['body']?['link']['webUrl']})
-
This will post the image inline in Teams using Markdown syntax for images.
Optional: Adjust action names if needed
- By default, Power Automate names actions as
Compose,Compose_2, etc. - Make sure any references in expressions use the correct action names, or rename actions for clarity.
Summary of expressions you will use:
Step Expression Count files length(body('List_files_in_folder')?['value'])Random index rand(0, sub(outputs('Compose'),1))Random file body('List_files_in_folder')?['value'][outputs('Compose_2')]Make sure to revise
'Compose'and'Compose_2'to your actual step names if different.
What the flow does
- Lists all memes from OneDrive folder.
- Counts number of files in the folder.
- Picks a random index.
- Retrieves the file metadata for the random meme.
- Creates a shareable anonymous link for the meme.
- Posts a message in Teams with the meme image embedded.
If you'd like, I can also provide you the JSON export of this flow to import it directly, or help you build an Adaptive Card version!
Let me know if you want me to do that or need any screenshots/walkthrough!
- User
i'm getting a JSON error from the create a link
- Assistant
Thanks for letting me know about the JSON error when using "Create sharing link" in OneDrive for Business.
This error usually happens when the File Path input to the "Create sharing link" action is incorrect in format or empty — typically because the expression used to get the
Pathis not resolving properly.Let's troubleshoot and make sure you're passing the correct File Path to that action.
How to fix the JSON error in "Create sharing link"
Common cause
- The Create sharing link action expects a string file path (e.g.,
/Chef Memes/meme1.jpg). - If you pass the entire file metadata object instead of just
Path, you get JSON validation errors. - Also, if your expression to extract
Pathfrom the previous output is wrong, it results in an invalid or null value.
Steps to fix
Step 1: Verify you are getting the random file metadata correctly
In the previous step where you get the random file metadata (a Compose action with expression like):
body('List_files_in_folder')?['value'][outputs('Compose_2')]- Add a Compose action immediately after it with input:
outputs('Compose_3')?['Path'](replace
Compose_3with your step name where you got the random file metadata)- Run the flow and check the run history.
- Confirm that this Compose outputs the file path string, e.g.,
/Chef Memes/meme1.jpg.
Step 2: Use that path output correctly in "Create sharing link"
In your Create sharing link action, for File Path, do NOT select dynamic content directly from the file metadata output because it is an object.
Instead, use an expression referencing the Compose action from Step 1, e.g.,
outputs('Compose_4')(if your compose with Path is called
Compose_4)Do NOT try to use something like:
body('Compose_3')?['Path']inside the Create sharing link's File Path field — this will cause JSON parsing errors.
Step 3: Alternative simpler approach - get path directly from List files output
Alternatively, you can get the path like this without intermediate Compose:
If your random index compose step is called
Compose_2, then your random file metadata expression is:body('List_files_in_folder')?['value'][outputs('Compose_2')]And to get the path to pass directly in Create sharing link > File Path, try this expression:
body('List_files_in_folder')?['value'][outputs('Compose_2')]?['Path']Paste this entire expression in File Path field (using Expression mode).
This should directly extract the string Path property that Create sharing link needs.
To recap: troubleshooting flow
-
List files in folder → outputs array of file metadata objects.
-
Compose 1: get length of the array.
-
Compose 2: random number between 0 and length-1.
-
Then in Create sharing link File Path use expression:
body('List_files_in_folder')?['value'][outputs('Compose_2')]?['Path']This gives the exact file path string.
Additional tip: Always test expressions in Compose first
To avoid these issues:
-
Before wiring expressions into "Create sharing link", create a Compose action with the expression and run the flow.
-
Check output to confirm it returns exactly the path string like
/Chef Memes/meme1.jpg.
If it looks good, copy the expression to the Create sharing link File Path.
Summary
-
The JSON error comes from passing an object instead of a string path to Create sharing link.
-
Fix: Pass
Pathattribute of your selected file as a string expression like:
body('List_files_in_folder')?['value'][outputs('Compose_2')]?['Path']- Test the expression with a Compose first.
If you like, you can share screenshots of your flow steps and expressions, and I’ll review to help debug further. Or I can provide you a fully working example export you can import to your tenant.
Let me know how you'd like to proceed!
- The Create sharing link action expects a string file path (e.g.,
- Assistant
It looks like your last message was empty. If you need further help resolving the JSON error with the OneDrive "Create sharing link" action or want me to provide a sample flow export or detailed screenshots, just let me know! Happy to assist.
- User
can you make visuals
- Assistant
Absolutely! Here’s a visual step-by-step guide with screenshots-style descriptions to help you create the Power Automate flow that picks a random Chef meme image from OneDrive and posts it in your Teams channel.
Visual Guide: Post a Random Chef Meme from OneDrive to Teams
Prerequisites:
- OneDrive folder containing Chef meme images (upload some images).
- Power Automate access.
- Teams access and permission to post messages.
Step 1: Create the flow
- Go to Power Automate.
- Click Create on the left panel.
- Select Scheduled cloud flow (or Instant cloud flow if you want a manual trigger).
- Name: Post Random Chef Meme to Teams.
- Set Start date/time (e.g. next Monday 8:00 AM).
- Set recurrence to every 1 week.
- Click Create.
Step 2: List files in OneDrive folder
- Click New step.
- Search OneDrive for Business and select List files in folder.
- In Folder, click the folder icon and navigate or paste your meme folder path (e.g.
/Chef Memes).
Example:
[image: List files in folder action with folder path set] open
Step 3: Count number of files
- Click New step.
- Search for Compose action.
- In Inputs, type the expression:
length(body('List_files_in_folder')?['value'])This counts how many files are in your folder.
Example:
[image: Compose action with length expression] open
Step 4: Generate a random index
- Add another Compose action.
- In Inputs, enter the expression:
rand(0, sub(outputs('Compose'), 1))It generates a random number between 0 and (file count - 1).
Example:
[image: Compose action with rand expression] open
Note:
Make sure 'Compose' above matches the name of your previous 'Compose' step; if your step name differs, replace it accordingly in the expression.
Step 5: Get the metadata of the random file
- Add a third Compose action.
- In Inputs, enter:
body('List_files_in_folder')?['value'][outputs('Compose_2')]This picks the file metadata at the random index.
Example:
[image: Compose action getting file metadata] open
Replace
'Compose_2'with the exact name of your random index compose step.
Step 6: Create sharing link for the selected file
- Add OneDrive for Business - Create sharing link action.
- For File Path, use the expression:
body('List_files_in_folder')?['value'][outputs('Compose_2')]?['Path']Paste this in the expression tab (don't select dynamic content).
-
Set Link type to
View. -
Set Scope to
Anonymous(or your preference).
Example:
[image: Create sharing link action with expression in File Path] open
Step 7: Post the meme to your Teams channel
- Add Microsoft Teams - Post a message (V3).
- Select your Team.
- Select your Channel.
- Set Message to this (use markdown to show image):
Here's a random Chef meme! 🍳 ?['body']?['link']?['webUrl']})Example:
[image: Teams post message action with markdown image] open
Step 8: Save and test
- Save your flow.
- Click Test > Manually > Run flow now.
- Check your Teams channel to see if the meme posts successfully!
Summary
This flow:
- Lists images in your folder.
- Picks one at random.
- Generates a sharing (view) link.
- Posts the image inline to Teams.
If you'd like, I can zip and share with you the exported flow JSON file you can import directly, or provide more help on Adaptive Cards if you want a nicer format.
Let me know!