Convert a Gallery into an HTML Email in Power Apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Okay so we've created a collection we can click on collect my gallery I have now written that collection as an HTML table in an email [Music] hey everyone my name is Andrew Hess and I'm a Power Platform developer if you're new here but today I wanted to answer one of the questions from you so this comes from an old video of one of my older power apps and it was writing multiple lines to a data source like SharePoint so we had a collection here and we could create new lines and we could fill out you know some different information in here and then we could write that to the data source and we were saying how to write multiple lines to the collection so what I did was a for all statement and I'll zoom in there and we'll look at the for all statement but I had a couple comments on this video now let me pull that over now one comment here was from Jean Louise Lewis Terra Nova and you know they were saying they watched other YouTubers and they said you could just patch The Collection just straight to a SharePoint list right so that is true you could just straight up patch The Collection as long as the data source and the collection match up perfectly it will then patch the collection but with for all you get a lot more control you can not patch certain fields if you wanted to you could do some math behind there of course you could do some math behind it inside the gallery too um you can concatenate things you could combine certain columns you get a lot more control when you do the for all statement maybe it's a little slower I haven't tested to know how long each one takes but if I did a four all statement I wouldn't do it more than 10 lines I think 10 lines is probably rows is probably the max I would do when I patch so that that's what I would think about there's nothing wrong with doing the for all there's nothing wrong with patching straight up the collection so I had another question on the same old video that I created and it comes from Mike Kiko and you know it was you know how can we send an email of the collection as data as HTML so I was like this is this is great for a video and pretty much I explained it through text but it's not that easy to explain you know there's some things in there that you got to manipulate to get the HTML to look good in an email so uh thank you Mike Kiko for the question let's get into it and create that video so first thing we're going to do is we're going to collect our gallery so these buttons are from my old video if you want to watch how to do that you can do that I'm going to take a button and we're going to create a new collection and I'm going to say for all for all what for all my rows in the gallery so for all Gallery I believe it's two so you can see here this is my gallery two for all Gallery two all items I'm going to collect so now I'm going to say what am I going to name my collection I'm going to name it a collection my gallery that's just what I'm going to name it and what are we going to collect we're going to collect first the title and that is going to be I believe it's text input one so we have text input one two three four you should rename these things but for this video I'm going to leave it like that text input one dot text uh food type text input two dot text allergies input three doctor and you get it I'll probably fast forward through here and double ending parentheses Okay so we've created a collection we can click on collect my gallery and then we can check out that collection so this is kind of new for me but they changed powerapps a little bit and they have variables here and this is collect my gallery we can go view table so we can see uh here is my collection it's in a different order than what I actually typed it in but we have title food type calories and allergies okay so we collected that uh Gallery but before we do all that if let me just kind of show you if I click on it again it's going to duplicate right it's going to say six rows now because we never cleared it right so we need to clear it we don't want it to duplicate so before my for all statement I'm going to say clear collection my gallery and if I can spell it right there we go okay so now when I collect it should only be three rows because that's how many we have in there as you can see it's three rows it is the exact collection okay so now we've collected next what I would do is I would come over here and I would create a new screen and I would use the template for an email this is what I would do I would just use this out of the box template and so I will create a new button here and it's just going to navigate to for me it's screen six and this is to email all right so we've collected my gallery now we're going to go to email now we're in this view with two email and in this message down here I'm most likely going to replace this with HTML so with an html text that is so I'm going to delete this it's going to give a red X up here but I'm going to insert html text I'm going to put it across the full screen and then I'm going to fix my red X up here so the Red X now is confused because the right here the body is now wrong it is now called let me figure out what my HTML is called html text 2. so html text 2 Dot html text okay and the reset function I will just remove that for now okay so we removed our red X's now we want to build out our html text we have that collection let's build out the HTML tag alright so I'm going to start building a table so what I'm going to do is I'm going to come up here I'm going to say you know table and start with just the table now you can add more in here right if you know your HTML you can add in here border equals one and width is 100 you can add some things in there like that then we're going to Ampersand and this is where we're going to create our our top row our column names so first it's going to be we'll do an ampersand then we're going to do th and we're going to do title then we're going to do th and food type have to remember my column names allergies th allergies and then I believe it's calories th ick calories okay so you can see right now we have the start of an HTML table now we want to populate the HTML table so and and we can do concat what are we going to concat we're going to cut that collection so collection my gallery and then we're going to do our our HTML so TR and TD and we're going to do title and then oh wait we forgot we forgot a double quote here so end title there we go now we're going to do TD TD so slash TD in that one and then start a new one and this should both be in double quotes because we're writing HTML and now we're writing our variable name again so this is food type and then we're going to do the same thing here we're going to do we can just copy this right here okay and the next one was allergies paste it in again and calories finally all right we can cat that you can see we actually have a table in here I do have one extra column why do I have one extra column Maybe there we go I took out that last TD so now we have a nice HTML table okay and then we can you know kind of fix this up and make it perfect although powerapps Will kind of work with you and so will email you don't have to do this but it is nice to do so we have to do and in the table all right so we have a table in there now before we send the email there's one more thing we need to do and if you look in here check out the intellisense if you're ever lost check out the intellisense right here is HTML now I'll probably zoom in right there but there's a you have you know two subject body Etc et cetera and then finally is HTML right after importance so I'm going to add in is HTML true and this probably needs to be in the brackets here there we go so now it's saying yes this is actually HTML that we want to send in the email so now we added that extra little bit in there because we're using html text and now we're going to send an email to myself okay so I'll press play we'll send an email to myself andrew.hess we'll send it to myself this is an HTML email and we'll press send now you could add more in here if you wanted to make this email better you know you could add your own text let people write more but that's just um all we did for this one so let's go check out my email so we can see here I have now written that collection as an HTML table in an email I think that's huge everyone's going to use this right I think a lot of people will be using this but there you go that's how you write a collection as HTML very simply through powerapps so thank you all for watching if this was helpful please like And subscribe my name is Andrew Hess see you next time
Info
Channel: Andrew Hess - MySPQuestions
Views: 3,961
Rating: undefined out of 5
Keywords: power apps, myspquestions, andrew hess, convert gallery to html, convert gallery to text, write a gallery into an email, html text, using html in power apps, how to power apps, power apps tutorial, power apps 101, beginner power apps, powerapps, collect the gallery, isHTML, convert gallery to email, power apps write gallery in email, email gallery in power apps
Id: pIrulq4cDtE
Channel Id: undefined
Length: 11min 44sec (704 seconds)
Published: Mon Sep 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.