1
00:00:00,680 --> 00:00:03,990
Before we create our CSP file, we're going to need some data.

2
00:00:04,460 --> 00:00:09,890
So let's set up a variable and this is going to be an array and it's going to have multiple arrays inside

3
00:00:09,890 --> 00:00:10,180
of it.

4
00:00:10,190 --> 00:00:12,710
So it's an array and it's going to have arrays within it.

5
00:00:12,890 --> 00:00:20,190
And the way that CSV files work typically is that they've got maybe a title for the data.

6
00:00:20,390 --> 00:00:25,130
So within the heading, that's going to be the first row and then the next item in the array is going

7
00:00:25,130 --> 00:00:26,040
to be the next row.

8
00:00:26,210 --> 00:00:29,750
So we'll have multiple rows so this can be rolled.

9
00:00:29,810 --> 00:00:32,090
Of course you can add in content as needed.

10
00:00:32,120 --> 00:00:35,530
If you add in if you want more columns, you can do that as well.

11
00:00:35,540 --> 00:00:42,080
And these values can be anything as these are just some placeholder values that we have that are going

12
00:00:42,080 --> 00:00:43,730
to be output into the file.

13
00:00:43,790 --> 00:00:50,570
So once you've created the overall structure of the data, you can just make sure that it is it is proper.

14
00:00:50,840 --> 00:00:55,610
When you output into the console, you can see you've got an array and a bunch of arrays within that

15
00:00:55,610 --> 00:00:56,000
array.

16
00:00:56,120 --> 00:01:01,040
And this is how the content is structured in preparation for the CSV file.

17
00:01:01,400 --> 00:01:07,670
So next to that, we're are ready to do is to create a function where we can export the data into a

18
00:01:07,670 --> 00:01:08,590
CSFI file.

19
00:01:08,780 --> 00:01:14,370
So whenever the user clicks the CSP download CSV file, we want to trigger this function.

20
00:01:14,390 --> 00:01:20,580
So creating a function, create CCSVI and then here's where we can passan data.

21
00:01:20,600 --> 00:01:25,740
So if our data is ever changing, then we can always update and change that data.

22
00:01:26,030 --> 00:01:32,000
So instead of console log, we can get rid of that and we're going to invoke passing in some data into

23
00:01:32,000 --> 00:01:34,960
a function and we do have that data that we just created.

24
00:01:35,180 --> 00:01:36,380
So let's pass that in.

25
00:01:36,620 --> 00:01:42,260
And the reason I'm doing it this way is so that it's going to be more dynamic and console logs or log

26
00:01:42,260 --> 00:01:42,980
out the data.

27
00:01:42,990 --> 00:01:44,430
So that's all that function is going to do.

28
00:01:44,720 --> 00:01:46,600
So we have something for the next lesson.

29
00:01:46,850 --> 00:01:48,190
So let's do a quick refresh.

30
00:01:48,200 --> 00:01:53,570
We click the button and we see the output of the data that we're passing in and we're going to build

31
00:01:53,570 --> 00:01:54,530
our CSFI out.

32
00:01:54,620 --> 00:01:56,300
So go ahead and add that into your project.

33
00:01:56,300 --> 00:02:03,440
Set up some dummy default data as well as the function in order to handle the creation of the CSP file,

34
00:02:03,740 --> 00:02:05,690
he could be ready to move on to the next lesson.

35
00:02:05,870 --> 00:02:08,770
We're going to do all of the magic, all the magic is going to happen.

36
00:02:08,810 --> 00:02:12,020
We're going to create the CSFI file all via JavaScript.

37
00:02:12,140 --> 00:02:12,950
So that's still to come.
