- [Instructor] Hi, and welcome
back to myexcelonline.com. Today we are going to talk about working with a PowerApps collection. If you want to learn more about
Microsoft Excel and Office join our Academy online course and access more than 1000
video training tutorials so that you can advance your level and get the promotions,
pay raises, or new jobs. The link to join our Academy online course is in the description. So, what exactly is a
PowerApps collection? Well, you can think of it
as a way that PowerApps automatically stores your data when you have not indicated another data
source in your application. And you can use this data
later on throughout your app. So, here I am on office.com
and I've already logged in. And if I want to get to PowerApps, I can go up here to the App Launcher. And if I've already used PowerApps, I will see it right here in this list. Otherwise, I can go to All Apps and scroll down to the Ps
and click on PowerApps. Now, once I'm in PowerApps, I'm going to want to
start with a blank app. So, I'm just going to
select this option here and I'll select the
first Blank Canvas app. Next, we'll be prompted with what name we would
like to call our app. So, for today, let's
just keep a track list of songs and the album that they're on, and the artists that perform the song. So, we'll just put, "Songs,"
and then hit Create. And now I have a blank canvas
to start creating my app. So, let's go up here to the Insert menu and let's insert a text label. And over here on the text property, let's change this to, "Song." Next, let's go up to Insert
and put in a text input box. And let's not have anything
in here by default. And over here on the left, let's rename this by
clicking these three dots and going to Rename and
calling this, "Song." Now, I'm going to move this down here, and then I'm going to select this box hold down Shift and select the label. And then I'm going to hit
Control C, Control V twice. I'm going to move this pair right here. And then I'm going to select the last two by holding down Shift and
moving those two right here. And then I'm going to click on this label and call this, "Artist." And then I'm going to click on this label and call this, "Album." And then I'm going to
click on this text box here and go to Rename by
clicking these three dots and hitting Rename and
call this, "Artist." And then I'm going to
click on this box here, click the three dots, go to
Rename and call this, "Album." So, now I have a basic data entry form where I can start collecting data in my PowerApps collection. If you are liking this video,
please give us a thumbs up and subscribe to our channel
and hit the bell button to get notified when we
release our weekly videos. So, once we enter data in
each one of these fields how are we going to get
that back to the collection that we want to create
inside of PowerApps? This is a very easy process. Let's just go up to insert
and let's insert a button and I'm going to drag
that button down here and let's do a couple things. On the text, let's put, "Add Song." And then over here with these three dots, let's rename this button
and call it, "btnAdd." And make sure the button is selected and I want you to look up here. OnSelect, when this button is selected or clicked by the user, what are we going to do? And this is where we are going to add our song information
that we enter here to a collection in the
back end of PowerApps. So, I'm going to highlight
false and hit Backspace. And there is a function
here called Collect. And what Collect does is, it takes whatever we have on the screen and it puts it into a collection. So, I'm going to put a left parenthesis and the first thing I'm
going to be asked for is the name of the collection. Well, we haven't determined
the name of the collection yet but we can create that
right here on the fly. So, let's call that, "SongList." And when we look in
PowerApps in a few minutes, you'll see where this goes. Next, I'm going to type a comma and then I'm going to
use the squiggly bracket, above the square bracket on the keyboard. So I'm gonna hold down Shift
and put squiggly bracket. And the first thing I'm going to do is define what the first
column in my collection is going to be. And in this case it's going to be Song. And then I'm going to put a colon and I want to now reference this box where the song is going to be entered. That is also called Song down
here where you can see it. So, I'm going to do Song and then I'm going to do .text because the .text is the property to get, what did I enter in that box? And if you look up here you can see that Song is
being highlighted in green and the box is being highlighted in green. So, this Song here
refers to this box here. So, next I'm going to put a comma and then I'm going to create a column in my collection
called, "Artist." And then I'm going to put a colon. And this time I want to reference this Artist box right here, which is also down here called, "Artist." So, Artist.text and you can
see now this is in green, matching this box here. And now this one's in pink
matching this box right here. So, finally, I bet you can
guess what the last argument is. I'm going to put a comma and then I'm going to put, "Album," as the new column inside my collection. And I'm going to put a
colon and put Album.text and now you can see blue
Song goes with this box, pink Artist goes with this box, and green Album goes with this box. So, now let's close up my syntax. I opened a squiggly bracket,
so I'm gonna close one. Then I opened a parenthesis,
so I'm going to close that. And now let's check out our app by clicking this button right here. Let's do, "Another Brick in the Wall." The artist would be Pink Floyd and the album would be, "The Wall." And then I'm going to
click the Add Song button and then I'm done. So, I'm going to X out of here and let's see where our data went. So, now if I click on these three dots and I go down to collections, I can see right here is where
my collection was created. And now once you have this
collection inside of PowerApps, you can actually use this
collection as a data source and work with it in other
ways throughout your app. Also, check out my column headers. They are Artist, Song, and Album, just like I had said I
wanted in this collection. So, right here, SongList is
the name of my collection and then Artist, Song, and Album are the names of my columns. And let's just go back for a minute and click on the add button and we can see right here,
SongList is the collection and the columns are
Song, Artist, and Album, just like we had indicated previously. So, now if I go to Insert and I can insert a vertical gallery, and I can actually use my
SongList collection right here. And if I move that over, you can see I am now
pulling from the collection that I've already created. So, if I wanna test out my app again, I'm going to go up here to Preview. And let's add a new song,
"Black Dog," Led Zeppelin. And this one I think
is on "Led Zeppelin 4." So, let's add that song as well. And you can see that
the song was added here and it was also added over
here to my collection, and I can keep doing that with every song that I would like to
add to this collection. So, there's a lot you can do working with collections behind the scenes inside of PowerApps. So, hopefully this video's given you a quick introduction
to what collections are and how to create them and then how to go back and access them to use throughout your app,
inside of Microsoft PowerApps. If you have any questions or comments, please leave them below
and we'll get back to you. Thanks for watching and
see you again next time. If you want to learn more about
Microsoft Excel and Office, join our Academy online course and access more than 1000
video training tutorials so that you can advance your level and get the promotions,
pay raises, or new jobs. The link to join our academy online course is in the description. - If you like this video,
subscribe to our YouTube channel. And if you're really serious about advancing your
Microsoft Excel skills, so you can stand out from the crowd, get the jobs, promotion, and
pay rises that you deserve, then click up here and join our
Academy online course today.