Hi,
I have a JSON which is feeded from PowerApps and consists of a number of values and strings as wells as an array from a powerapps gallery. The schema has the arrays at the bottom, called Product and Version.
{
"type": "array",
"items": {
"type": "object",
"properties": {
"CSM": {
"type": "string"
},
"PP": {
"type": "string"
},
"EngStat": {
"type": "string"
},
"KeyAch": {
"type": "string"
},
"MFR": {
"type": [
"number",
"null"
]
},
"Name": {
"type": "string"
},
"CurrentUserMail": {
"type": "string"
},
"Portfolio": {
"type": "string"
},
"QCCR": {
"type": [
"string",
"null"
]
},
"RelStat": {
"type": "string"
},
"Rev19": {
"type": [
"number",
"null"
]
},
"Support": {
"type": [
"string",
"null"
]
},
"Tier": {
"type": "string"
},
"Version": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Current_x0020_Product_x0020_Vers": {
"type": "string"
}
},
"required": [
"Current_x0020_Product_x0020_Vers"
]
}
},
"Product": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Product": {
"type": "string"
}
}
}
}
},
"required": [
"CSM",
"CurrentUserMail",
"EngStat",
"Name",
"PP",
"Portfolio",
"Product",
"RelStat",
"Tier"
]
}
}
I am building a html email with JSON regular fields added, which works fine.
However I also want to add both (complete) Product and Version arrays to the email. Once I add Product as dynamic contents Flow will add an "Apply to each" and this is not what I want. Actually this sends out n mails, with n the size of the array 😉
I'd like to have the whole contents of the arrays added to the mail at once. The size of the array is not constant, but may vary from 1 to 10.
Any help appreciated!
Thanks
Stefan
Solved! Go to Solution.
Hi again!
Try with the following
body('Create_HTML_Table_Versions')
For some reason, the new UI version rolled out at the beggining of this week, is mucho more restrictive when showing dynamic content options
If you need to change HTML table format (css etc) please let us know
Hope this helps
Proud to be a Flownaut!
Proud to be a Flownaut!
thanks, good hint, looks I get the data into proper format
Version table
However, and that appears so often, after save & test run, the new tables do not show up in dynamic content.
Do you know how to refrence them via expressions?
I tried simply
body('Create HTML Table Versions')
but that gives an error in Flow Checker.
Correct to include a valid reference....
Do you have any advice?
Hi again!
Try with the following
body('Create_HTML_Table_Versions')
For some reason, the new UI version rolled out at the beggining of this week, is mucho more restrictive when showing dynamic content options
If you need to change HTML table format (css etc) please let us know
Hope this helps
Proud to be a Flownaut!
yes, thats it, thanks a lot, I will mark the question as solved!
Still one more question on formating the output, my mail now contains
["
Product
Product A
Product B
Product C
"] ["
Current Version
4.7
4.4
9.1
"]
including [...] and "...".
Would you know how to get rid of those as well?
Hi!
It looks like you are adding the array directly to the email body, instead of the 'Create HTML table' outputs.
I mean an array is a list of elements wrapped inside characters [ and ]. If elements are string, they are also wrapped inside doublequotes:
["Apple", "Lemon", "Orange"]
So it looks lika a couple of arrays with one single element inside
Can you share a screenshot from your current flow design?
BTW, thanx for marking this topic as solved.
This way other community members facing this same problem in the future have the chance to find a solution faster.
Thanx for your contribution to keep this community great!
Proud to be a Flownaut!
Hi,
Here's the overview of my flow pieces
Create the 2 html tables, getting Product and Version as dynamic content from JSON part
create tables
bottom of html mail
For the 2 bodies I simply used your suggested expressions
body('Create_HTML_Table_Product')
body('Create_HTML_Table_Version')
This results in a mail with the correct details but in the above mentioned format.
If you have a new suggestion let me know.
thanks!
Weird...
Please inspect both 'Create HTML table' action blocks execution, and doublecheck if their outputs look like this
Version table
If so, i would suggest to add temporarily a new 'Send an email' just for troubleshooting purposes, send this new email to you, add to the body both expressions only, I mean without the rest of the stuff you have in your current 'SEnd an email' body
Thanx!
Proud to be a Flownaut!
same effect still, while checking the flow html body output of a test run looks formated OK, the mail content is malformated.
This is same for both Product and Version tables.
mail looks like
HTML mail content
<br>["<table><thead><tr><th>Product</th></tr></thead><tbody><tr><td>Product Manager</td></tr><tr><td>Test Manager</td></tr><tr><td>Directory</td></tr></tbody></table>"]
["<table><thead><tr><th>Current_x0020_Product_x0020_Vers</th></tr></thead><tbody><tr><td>4.7</td></tr><tr><td>4.4</td></tr><tr><td>9.1</td></tr></tbody></table>"]
which indeed contains what the mail shows, incl backets [ ]
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
28 | |
26 | |
23 | |
17 | |
10 |
User | Count |
---|---|
61 | |
54 | |
29 | |
27 | |
24 |