Skip to content

Commit

Permalink
Merge pull request #92 from Solanki-Manish/Sharing-PowerAutomateSamples
Browse files Browse the repository at this point in the history
Sharing power automate samples
  • Loading branch information
Katerina-Chernevskaya committed Jun 18, 2024
2 parents 8c3b535 + f62566f commit bc40ec1
Show file tree
Hide file tree
Showing 10 changed files with 482 additions and 0 deletions.
98 changes: 98 additions & 0 deletions samples/Send-Inline-Image-In-Teams-Channel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Send Inline Image In Teams Channel

## Summary

This sample gets the image from SharePoint document library and post it on *Microsoft Teams* channel using **Power Automate**. The flow utilizes standard **Send Microsoft graph request** action to overcome the payload size limit of 28 KB.

![Flow overview](/samples/Send-Inline-Image-In-Teams-Channel/assets/flow-overview.png "Flow overview")


## Applies to

* [Power Automate](https://docs.microsoft.com/power-automate/)
* [Microsoft Teams](https://learn.microsoft.com/en-us/microsoftteams/)

## Compatibility

![Premium License](https://img.shields.io/badge/Premium%20License-Not%20Required-green.svg "Premium license not required")
![On-Premises Connectors](https://img.shields.io/badge/On--Premises%20Connectors-No-green.svg "Does not use on-premise connectors")
![Custom Connectors](https://img.shields.io/badge/Custom%20Connectors-Not%20Required-green.svg "Does not use custom connectors")


## Contributors

* [Manish Solanki](https://github.com/Solanki-Manish)


## Version history

Version|Date|Comments
-------|----|--------
1.0|May 21, 2024|Initial release


## Features

This sample illustrates the following concepts:

* Post embed image in Teams Channel message
* Overcome the payload size limit (28 KB)
* Send a Microsoft Graph HTTP request using standard action
* Expression


## Prerequisites

* This Flow requires an image to be present in SharePoint document library (inside site asset).
* A Microsoft Teams with a channel where image needs to be shared via message.

### Connection References
The solution includes two connection references.
* SharePoint Connection
* Microsoft Teams Connection

## Minimal Path to Awesome

### Import Solution

* [Download](./solution/send-inline-image-in-teams-channel.zip) the `.zip` from the `solution` folder
* [Import](https://learn.microsoft.com/en-us/power-apps/maker/data-platform/import-update-export-solutions) the `.zip` file using **Solutions** > **Import Solution**.

### Configure Flow

1. Once the solution is imported, edit it
1. Select **Get file content** action and replace the **Site Address** and the **File Identifier** to point to your SharePoint site and image file.
![Configure Get file content action](./assets/config1.png)
1. Select **Get team** action and choose a MS team from the drop down.
![Configure Get team action](./assets/config2.png)
1. Save and test the flow.

### Using the source code

You can also use the [Power Apps CLI](https://docs.microsoft.com/powerapps/developer/data-platform/powerapps-cli) to pack the source code by following these steps:

* Clone the repository to a local drive
* Pack the source files back into a solution `.zip` file:

```bash
pac solution pack --zipfile pathtodestinationfile --folder pathtosourcefolder --processCanvasApps
```

Making sure to replace `pathtosourcefolder` to point to the path to this sample's `sourcecode` folder, and `pathtodestinationfile` to point to the path of this solution's `.zip` file (located under the `solution` folder)
* Within **Power Apps Studio**, import the solution `.zip` file using **Solutions** > **Import Solution** and select the `.zip` file you just packed.

## Help

We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues.

If you encounter any issues while using this sample, you can [create a new issue](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=bug-report.yml&sample=Send-Inline-Image-In-Teams-Channel&authors=@Solanki-Manish&title=Send-Inline-Image-In-Teams-Channel).

For questions regarding this sample, [create a new question](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=question.yml&sample=Send-Inline-Image-In-Teams-Channel&authors=@Solanki-Manish&title=Send-Inline-Image-In-Teams-Channel).

Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/powerapps-samples/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&template=suggestion.yml&sample=Send-Inline-Image-In-Teams-Channel&authors=@Solanki-Manish&title=Send-Inline-Image-In-Teams-Channel).

## Disclaimer

**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**

<img src="https://m365-visitor-stats.azurewebsites.net/powerplatform-samples/samples/Send-Inline-Image-In-Teams-Channel" aria-hidden="true" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions samples/Send-Inline-Image-In-Teams-Channel/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
[
{
"name": "pnp-powerplatform-samples-Send-Inline-Image-In-Teams-Channel",
"source": "pnp",
"title": "Send Inline Image In Teams Channel",
"shortDescription": "This sample gets the image from SharePoint document library and post it on Microsoft Teams channel using Power Automate.",
"url": "https://github.com/pnp/powerplatform-samples/tree/main/samples/Send-Inline-Image-In-Teams-Channel",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/powerplatform-samples/tree/main/samples/Send-Inline-Image-In-Teams-Channel",
"longDescription": [
"This sample gets the image from SharePoint document library and post it on Microsoft Teams channel using Power Automate."
],
"creationDateTime": "2024-05-21",
"updateDateTime": "2024-05-21",
"products": [
"Power Automate"
],
"tags": [
"Image",
"Teams"
],
"categories": [
"CLOUD-FLOW"
],
"metadata": [
{
"key": "POWERAPPS-EXPERIMENTAL",
"value": "No"
},
{
"key": "POWERAPPS-PREMIUM",
"value": "No"
},
{
"key": "POWERAPPS-ONPREM",
"value": "No"
},
{
"key": "POWERAPPS-CUSTOMCONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/powerplatform-samples/raw/main/samples/Send-Inline-Image-In-Teams-Channel/assets/flow-overview.png",
"alt": "App preview"
}
],
"authors": [
{
"gitHubAccount": "Solanki-Manish",
"pictureUrl": "https://github.com/Solanki-Manish.png",
"name": "Manish Solanki"
}
],
"references": [
{
"name": "Microsoft Power Platform documentation",
"description": "Discover how to make the most of Microsoft Power Platform products with online training courses, docs, and videos covering product capabilities and how-to guides.",
"url": "https://learn.microsoft.com/power-platform/"
}
]
}
]
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Entities />
<Roles />
<Workflows />
<FieldSecurityProfiles />
<Templates />
<EntityMaps />
<EntityRelationships />
<OrganizationSettings />
<optionsets />
<CustomControls />
<EntityDataProviders />
<connectionreferences>
<connectionreference connectionreferencelogicalname="crfc6_sharedsharepointonline_383e5">
<connectionreferencedisplayname>SharePoint SendInlineImageInTeamChannelMessage-383e5</connectionreferencedisplayname>
<connectorid>/providers/Microsoft.PowerApps/apis/shared_sharepointonline</connectorid>
<iscustomizable>1</iscustomizable>
<statecode>0</statecode>
<statuscode>1</statuscode>
</connectionreference>
<connectionreference connectionreferencelogicalname="crfc6_sharedteams_0aed3">
<connectionreferencedisplayname>Microsoft Teams SendInlineImageInTeamChannelMessage-0aed3</connectionreferencedisplayname>
<connectorid>/providers/Microsoft.PowerApps/apis/shared_teams</connectorid>
<iscustomizable>1</iscustomizable>
<statecode>0</statecode>
<statuscode>1</statuscode>
</connectionreference>
</connectionreferences>
<Languages>
<Language>1033</Language>
</Languages>
</ImportExportXml>
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<ImportExportXml version="9.2.24053.162" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SolutionManifest>
<UniqueName>SendInlineImageInTeamChannelMessage</UniqueName>
<LocalizedNames>
<LocalizedName description="Send Inline Image In Team Channel Message" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<Version>1.0.0.0</Version>
<Managed>2</Managed>
<Publisher>
<UniqueName>Cr21a13</UniqueName>
<LocalizedNames>
<LocalizedName description="CDS Default Publisher" languagecode="1033" />
</LocalizedNames>
<Descriptions />
<EMailAddress xsi:nil="true"></EMailAddress>
<SupportingWebsiteUrl xsi:nil="true"></SupportingWebsiteUrl>
<CustomizationPrefix>crfc6</CustomizationPrefix>
<CustomizationOptionValuePrefix>12078</CustomizationOptionValuePrefix>
<Addresses>
<Address>
<AddressNumber>1</AddressNumber>
<AddressTypeCode xsi:nil="true"></AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode xsi:nil="true"></ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
<Address>
<AddressNumber>2</AddressNumber>
<AddressTypeCode xsi:nil="true"></AddressTypeCode>
<City xsi:nil="true"></City>
<County xsi:nil="true"></County>
<Country xsi:nil="true"></Country>
<Fax xsi:nil="true"></Fax>
<FreightTermsCode xsi:nil="true"></FreightTermsCode>
<ImportSequenceNumber xsi:nil="true"></ImportSequenceNumber>
<Latitude xsi:nil="true"></Latitude>
<Line1 xsi:nil="true"></Line1>
<Line2 xsi:nil="true"></Line2>
<Line3 xsi:nil="true"></Line3>
<Longitude xsi:nil="true"></Longitude>
<Name xsi:nil="true"></Name>
<PostalCode xsi:nil="true"></PostalCode>
<PostOfficeBox xsi:nil="true"></PostOfficeBox>
<PrimaryContactName xsi:nil="true"></PrimaryContactName>
<ShippingMethodCode xsi:nil="true"></ShippingMethodCode>
<StateOrProvince xsi:nil="true"></StateOrProvince>
<Telephone1 xsi:nil="true"></Telephone1>
<Telephone2 xsi:nil="true"></Telephone2>
<Telephone3 xsi:nil="true"></Telephone3>
<TimeZoneRuleVersionNumber xsi:nil="true"></TimeZoneRuleVersionNumber>
<UPSZone xsi:nil="true"></UPSZone>
<UTCOffset xsi:nil="true"></UTCOffset>
<UTCConversionTimeZoneCode xsi:nil="true"></UTCConversionTimeZoneCode>
</Address>
</Addresses>
</Publisher>
<RootComponents>
<RootComponent type="29" id="{19b43050-f023-ef11-840a-002248d5e947}" behavior="0" />
</RootComponents>
<MissingDependencies />
</SolutionManifest>
</ImportExportXml>
Loading

0 comments on commit bc40ec1

Please sign in to comment.