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

Base64 is producing too many images in my html table because of Append Variable

I have a flow which is pulling from a SharePoint Media Library. It is going to send the headshot proofs to all staff for their approval of the one they'd like to be their headshot.

I'll be giving the steps below in text and images. To keep it tidy I'll collapse the images as Spoilers. I'll put the input and output of each stage if applicable/valuable, and colour-code for references.

 

Update while I was writing this originally:

So... as i was ALMOST done writing this all out, i figured out the problem but not the solution

I'm Appending a Variable within an Apply to Each but it's still appending it for all of the runs as I have it set to concurrent. but I don't know how to change the input of the variable to be unique for each Employee receiving an email, but still only sending 1 email per employee. Help!

 

This is the email the testers are getting. Each of us should only be getting 2 images,  but we are all getting the same 4 as it's populated by the varRows. 

 

adriennevh_9-1708018257595.png

adriennevh_9-1708018257595.png

 

1. Manual Trigger

2. Get Items - with filter query Status eq 'Ready for Review'

3. Initialize Variable - varCSS - for the table CSS to be included in the email at the end

4. Initialize Variable - varTitle - String - Value: <table> <tr> <th> File Name </th> <th> Headshot </th>

5. Initialize Variable - varRows - String - Value: blank

6. Select - Users - From: Value: outputs('Get_items')?['body/value']

Map

Name: item()?['Employee/DisplayName']

Email: item()?['Employee/Email']

7. Compose - Unique Users

Inputs: union(body('Select_-_Users'),body('Select_-_Users'))

8. Initialize Variable - ImageBase64 - String - Value: blank

9. Apply to each - User - Select an output: outputs('Compose_-_Unique_Users')

9a. Scope - User Info

9a1. Compose - Users Full Name - Inputs: items('Apply_to_each_-_User')?['Name']

9a2. Compose - Users First Name - Inputs: first(split(outputs('Compose_-_Users_Full_Name'),' '))

9a3. Compose - Users Email Address - Inputs: items('Apply_to_each_-_User')?['Email']

9b. Scope - User Items

9b1. Filter array - User Items

Input result after run

 

Spoiler

From: outputs('Get_items')?['body/value']"}]

[
{
"@odata.etag": "\"19\"",
"ItemInternalId": "8",
"ID": 8,
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"ProjectLead#Claims": "i:0#.f|membership|Name1@domain.ca",
"MediaServiceImageTags": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
"TermGuid": "ffffffff-ffff-ffff-ffff-fffffffff006",
"WssId": 3,
"Label": "outdoor",
"Path": null,
"Value": "outdoor|ffffffff-ffff-ffff-ffff-fffffffff006"
}
],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [
3
],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-13T16:24:10Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|Name1@domain.ca",
"Modified": "2024-02-14T19:00:43Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|Name1@domain.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fDoug%2b1%2bsmall.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten
},
"{Link}": "https://domain.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Doug%201%20s...",
"{Name}": "Doug 1 small",
"{FilenameWithExtension}": "Doug 1 small.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Doug 1 small.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "18.0"
},
{
"@odata.etag": "\"17\"",
"ItemInternalId": "9",
"ID": 9,
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"ProjectLead#Claims": "i:0#.f|membership|Name1@domain.ca",
"MediaServiceImageTags": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
"TermGuid": "ffffffff-ffff-ffff-ffff-fffffffff006",
"WssId": 3,
"Label": "outdoor",
"Path": null,
"Value": "outdoor|ffffffff-ffff-ffff-ffff-fffffffff006"
}
],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [
3
],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-13T18:35:49Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|Name1@domain.ca",
"Modified": "2024-02-14T19:00:43Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|Name1@domain.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fDoug%2b2%2bsmall.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten
},
"{Link}": "https://domain.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Doug%202%20s...",
"{Name}": "Doug 2 small",
"{FilenameWithExtension}": "Doug 2 small.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Doug 2 small.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "16.0"
},
{
"@odata.etag": "\"4\"",
"ItemInternalId": "11",
"ID": 11,
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|andrew.nguyen@domain.ca",
"DisplayName": "Andrew Nguyen",
"Email": "Andrew.Nguyen@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=A...",
"Department": null,
"JobTitle": null
},
"ProjectLead#Claims": "i:0#.f|membership|andrew.nguyen@domain.ca",
"MediaServiceImageTags": [],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-14T19:27:59Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|Name1@domain.ca",
"Modified": "2024-02-14T19:29:08Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|Name1@domain.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fStock%2bimage%2b1.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten
},
"{Link}": "https://domain.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Stock%20imag...",
"{Name}": "Stock image 1",
"{FilenameWithExtension}": "Stock image 1.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Stock image 1.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "4.0"
},
{
"@odata.etag": "\"3\"",
"ItemInternalId": "12",
"ID": 12,
"Title": "Customer service. Woman operator call center with headphones and microphone with laptop. Support, assistance, call center, hot line, help, response, consultation. Vector illustration",
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|andrew.nguyen@domain.ca",
"DisplayName": "Andrew Nguyen",
"Email": "Andrew.Nguyen@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=A...",
"Department": null,
"JobTitle": null
},
"ProjectLead#Claims": "i:0#.f|membership|andrew.nguyen@domain.ca",
"MediaServiceImageTags": [],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-14T19:27:59Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|Name1@domain.ca",
"Modified": "2024-02-14T19:29:16Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|Name1@domain.ca",
"DisplayName": "Name1",
"Email": "Name1@domain.ca",
"Picture": "https://domain.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=N...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|Name1@domain.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fStock%2bimage%2b2.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten"
},
"{Link}": "https://domain.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Stock%20imag...",
"{Name}": "Stock image 2",
"{FilenameWithExtension}": "Stock image 2.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Stock image 2.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "3.0"
}
]

 

@equals(item()?['Employee/Email'], outputs('Compose_-_Users_Email_Address'))

Output result after run

 

Spoiler
[
{
"@odata.etag": "\"19\"",
"ItemInternalId": "8",
"ID": 8,
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"ProjectLead#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"MediaServiceImageTags": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
"TermGuid": "ffffffff-ffff-ffff-ffff-fffffffff006",
"WssId": 3,
"Label": "outdoor",
"Path": null,
"Value": "outdoor|ffffffff-ffff-ffff-ffff-fffffffff006"
}
],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [
3
],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-13T16:24:10Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"Modified": "2024-02-14T19:00:43Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fDoug%2b1%2bsmall.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten"
"{Link}": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Doug%201%20...",
"{Name}": "Doug 1 small",
"{FilenameWithExtension}": "Doug 1 small.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Doug 1 small.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "18.0"
},
{
"@odata.etag": "\"17\"",
"ItemInternalId": "9",
"ID": 9,
"Status": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
"Id": 1,
"Value": "Ready for review"
},
"Status#Id": 1,
"ProjectLead": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"ProjectLead#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"MediaServiceImageTags": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy",
"TermGuid": "ffffffff-ffff-ffff-ffff-fffffffff006",
"WssId": 3,
"Label": "outdoor",
"Path": null,
"Value": "outdoor|ffffffff-ffff-ffff-ffff-fffffffff006"
}
],
"MediaServiceImageTags@odata.type": "#Collection(Microsoft.Azure.Connectors.SharePoint.SPListExpandedTaxonomy)",
"MediaServiceImageTags#WssId": [
3
],
"MediaServiceImageTags#WssId@odata.type": "#Collection(Int64)",
"Created": "2024-02-13T18:35:49Z",
"Author": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Author#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"Modified": "2024-02-14T19:00:43Z",
"Editor": {
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"DisplayName": "Adrienne Van Halem",
"Email": "Adrienne.VanHalem@ipc.on.ca",
"Picture": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/_layouts/15/UserPhoto.aspx?Size=L&AccountName=...",
"Department": "IPC - CSD",
"JobTitle": "Information Management Specialist"
},
"Editor#Claims": "i:0#.f|membership|adrienne.vanhalem@ipc.on.ca",
"OData__DisplayName": "",
"{Identifier}": "Staff%2bHeadshots%2bfor%2bApproval%252fDoug%2b2%2bsmall.jpg",
"{IsFolder}": false,
"{Thumbnail}": {
Tumbnail Data Removed to shorten"
},
"{Link}": "https://ipconca.sharepoint.com/sites/IMDevEnvironment/Staff%20Headshots%20for%20Approval/Doug%202%20...",
"{Name}": "Doug 2 small",
"{FilenameWithExtension}": "Doug 2 small.jpg",
"{Path}": "Staff Headshots for Approval/",
"{FullPath}": "Staff Headshots for Approval/Doug 2 small.jpg",
"{IsCheckedOut}": false,
"{VersionNumber}": "16.0"
}
]

 

 

9b2. Compose - User Item Count - Inputs: length(body('Filter_array_-_User_Items'))

Result after run

 

Spoiler

Input: 2

Output: 2

 

9c. Apply to Each - Photo - Select an output: body('Filter_array_-_User_Items')

9c1. Get file properties - Id: items('Apply_to_each_-_Photo')?['ID']

Spoiler
adriennevh_7-1708018009729.png

 


 

 

9c2. Get file contents - File identifier: outputs('Get_file_properties')?['body/{Identifier}']

Spoiler
adriennevh_8-1708018050091.png

 

9c3. Compose base64 - Inputs: base64(body('Get_file_content'))

9c4. Compose ImageBase64 - Inputs: outputs('Compose_base64')

9c5. Compose Image - Inputs: <img src="data&colon;image/jpeg;base64,@{outputs('Compose_ImageBase64')}" />

9c6. Append varRows - <tr> <td>@{outputs('Get_file_properties')?['body/{Name}']}</td> <td>@{outputs('Compose_Image')} </td>

Spoiler
<tr> <td>Doug 1 small</td> <td><img src="data&colon;image/jpeg;base64,/9j/long base64 code removed/mf//Z" /> </td>

9c7. Update file properties

Id: items('Apply_to_each_-_Photo')['ID']

Status Value: Sent for review

9d. Select - List File Names

From: body('Filter_array_-_User_Items')

Map: concat(item()?['{Name}'])

9e. Compose - Option Names - Inputs: join(body('Select_-__List_File_Names'),',')

9f. Send email with Options

To: outputs('Compose_-_Users_Email_Address')

User Options: outputs('Compose_-_Option_Names')

Body: @{variables('varCSS')}@{variables('varTitle')}@{variables('varRows')}

Use only HTML message: Yes

9g. Apply to each - Name check

Condition  - this part after the issue and doesn't seem to be affecting it

 

 

 

 

adriennevh_1-1708014034905.png

adriennevh_2-1708014112450.png

adriennevh_4-1708014138327.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
SamLed
Super User
Super User

Hi @adriennevh,

 

It's a great project, you've already had a lot of work done, but allow me, without wanting to offend you, to say that I find the design of your flow too complex. Let me share with you how I would have done it.

 

First I would split this flow into 2 flows :

  • A main flow to manage users info
  • A sub flow which take user info as input, build HTML, send email and update item for selected picture

Using that design you get many benefits:

  • User's apply to each concurrent mode use in main flow
  • One flow instance (sub flow) per user
  • No mess with variable as you dont need concurrent mode to build Email HTML

Use this design, you'll have to create a solution and build both flow inside that solution then you'll be able to use the following action to call your sub flow:

SamLed_0-1709077347092.png

 

When selected child flow trigger has input set up, this action will propose to populate it. You can have an array as input and pass all data of a user to child flow.  

 

 

HTML Build design pattern:

You can simplify HTML build by saving variable and loop use, here a flow to illustrate:

SamLed_0-1709111573234.png

SamLed_1-1709111679314.png

 

outputs:

SamLed_3-1709078897189.png

 

CRLF variable is just a string with a blank line, this is just making HTML more readable in last compose outputs  for debug purpose. 

 
Data optimization:
  • Minimize data to deal with in user apply to each using "Select" after having filtered by email.
SamLed_7-1709076646008.png

From: body('Filter_array_-_User_Items')

Fullname: item()?['Name']

Firstname: first(split(item()?['Name'],' '))

Email: item()?['Email']

ItemID: item()?['ID']

 

This way you get an array of all required user data for later use, you save so many compose, filter, and loop.

 

You could also create a view in your document library which shows only column required by your flow and configure "Get items" action with it, it will improve data fetch performance from library:

SamLed_1-1709078416209.png

 

 

I can see some other possible optimizations, I'll let you see if you're already interested by those I related, that's already big changes to your current flow, but rebuild your flow will be less time spent than trying to find a solution to your variable issue. Solution you won't be able to find because appending to variable inside a concurrent loop will only work if you need to get one overhall array in an unordered way but totally incompatible with your use case where variable should contains only data of one user at once.

 

Feel free to ping me if you need support, I can help you with, I like your interesting project 😉

______________________________________________________________

If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.

   

 

 

 

View solution in original post

2 REPLIES 2
SamLed
Super User
Super User

Hi @adriennevh,

 

It's a great project, you've already had a lot of work done, but allow me, without wanting to offend you, to say that I find the design of your flow too complex. Let me share with you how I would have done it.

 

First I would split this flow into 2 flows :

  • A main flow to manage users info
  • A sub flow which take user info as input, build HTML, send email and update item for selected picture

Using that design you get many benefits:

  • User's apply to each concurrent mode use in main flow
  • One flow instance (sub flow) per user
  • No mess with variable as you dont need concurrent mode to build Email HTML

Use this design, you'll have to create a solution and build both flow inside that solution then you'll be able to use the following action to call your sub flow:

SamLed_0-1709077347092.png

 

When selected child flow trigger has input set up, this action will propose to populate it. You can have an array as input and pass all data of a user to child flow.  

 

 

HTML Build design pattern:

You can simplify HTML build by saving variable and loop use, here a flow to illustrate:

SamLed_0-1709111573234.png

SamLed_1-1709111679314.png

 

outputs:

SamLed_3-1709078897189.png

 

CRLF variable is just a string with a blank line, this is just making HTML more readable in last compose outputs  for debug purpose. 

 
Data optimization:
  • Minimize data to deal with in user apply to each using "Select" after having filtered by email.
SamLed_7-1709076646008.png

From: body('Filter_array_-_User_Items')

Fullname: item()?['Name']

Firstname: first(split(item()?['Name'],' '))

Email: item()?['Email']

ItemID: item()?['ID']

 

This way you get an array of all required user data for later use, you save so many compose, filter, and loop.

 

You could also create a view in your document library which shows only column required by your flow and configure "Get items" action with it, it will improve data fetch performance from library:

SamLed_1-1709078416209.png

 

 

I can see some other possible optimizations, I'll let you see if you're already interested by those I related, that's already big changes to your current flow, but rebuild your flow will be less time spent than trying to find a solution to your variable issue. Solution you won't be able to find because appending to variable inside a concurrent loop will only work if you need to get one overhall array in an unordered way but totally incompatible with your use case where variable should contains only data of one user at once.

 

Feel free to ping me if you need support, I can help you with, I like your interesting project 😉

______________________________________________________________

If I have answered your question, please Accept the post as solution.
If you like my response, please Thumbs Up.

   

 

 

 

This is amazing! Thank you so much, not offended at all. Not knowing the tools as well as I want to, means I go by indirect methods. I'll work through implementing this and re-post if I continue to have issues.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (958)