﻿WEBVTT

00:00:00.000 --> 00:00:04.366
Hi! Welcome to the XMPie uCreate Print training.

00:00:04.366 --> 00:00:12.099
In the previous tutorial, we turned static InDesign text and graphics into dynamic objects using database values. 

00:00:12.100 --> 00:00:16.800
In this tutorial, we look at using functions to change the database value, 

00:00:16.800 --> 00:00:24.400
and logic to control the document based on the information from the database, rather than using the database value itself.

00:00:24.400 --> 00:00:30.666
To start, download the sample ZIP file from the Downloads tab and uncompress the archive. 

00:00:30.666 --> 00:00:38.199
If you have already completed the previous tutorial in this series, you can continue to use the same files you already downloaded.

00:00:38.200 --> 00:00:45.066
There is a PDF included in the ZIP file that will step you through the tutorial if you want to do it later offline.

00:00:45.066 --> 00:00:50.766
Open the EDU Postcard InDesign file. 

00:00:50.766 --> 00:01:00.866
The first thing to look at is on page 2. Our client’s instructions are to display the City in upper-case, but the data is in title-case.

00:01:00.866 --> 00:01:07.032
Since we only use the city in this one location, I will edit the City Content object. 

00:01:07.033 --> 00:01:15.599
This will open the Rule editor with the expression currently used – which is simply to get the value from the City field of the database.

00:01:15.600 --> 00:01:21.100
Click on the City drop-down, scroll up and select UPPERCASE.

00:01:21.100 --> 00:01:27.300
Notice how the City database field is now inside the brackets of the UPPERCASE function.

00:01:27.300 --> 00:01:32.866
The preview area at the bottom of the rule editor shows the result of the new expression.

00:01:32.866 --> 00:01:39.532
When I save, the rule is updated and anywhere in the document where the City content object has been placed 

00:01:39.533 --> 00:01:42.099
will be updated with the new rule.

00:01:42.100 --> 00:01:48.666
The next instruction from the customer is that Engineering students should get a higher discount percentage. 

00:01:48.666 --> 00:01:56.166
In this case, the discount information is not in the database, so we need to create a new Content object.

00:01:56.166 --> 00:02:02.866
Enter a name for the Content object. The Content object will be used to change text in the document.

00:02:02.866 --> 00:02:08.299
And we want to edit the rule straight away, so check this box and click OK.

00:02:08.300 --> 00:02:14.900
This time we need to use if-then-else logic, so change Value = to If.

00:02:14.900 --> 00:02:20.766
If the School field in the database equals Engineering. 

00:02:20.766 --> 00:02:27.632
Then the value will be a text string:  20, else 15.

00:02:27.633 --> 00:02:32.033


00:02:32.033 --> 00:02:38.833
Use the Text tool to select the static text and double-click the Content object to place it into the design.

00:02:38.833 --> 00:02:43.133
Scroll through the records to confirm that the logic is working as expected. 

00:02:43.133 --> 00:02:49.566
Here we have an Engineering student and the discount is changed to 20 percent.

00:02:49.566 --> 00:02:56.699
The discount amount also appears on the other page, so remember to update it there too.

00:02:56.700 --> 00:03:02.700
Next, if we know which School the student is interested in, we would like to welcome the student to that school 

00:03:02.700 --> 00:03:04.700
rather than to the university. 

00:03:04.700 --> 00:03:10.233
But when there is no school in the database, we need to welcome the student to EDU University.

00:03:10.233 --> 00:03:14.633
Create a new Content object, and enter a name.

00:03:14.633 --> 00:03:19.799


00:03:19.800 --> 00:03:26.166
Again, we need to use logic. This time, we need to determine if the School database field has a value. 

00:03:26.166 --> 00:03:31.999
uCreate Print has a function called IsNullOrEmpty which will do this.

00:03:32.000 --> 00:03:34.933
Now select the School database field.

00:03:34.933 --> 00:03:41.499
IsNullOrEmpty will return true or false, so we don’t need any comparison operators.

00:03:41.500 --> 00:03:46.366
Now, if the field is empty, we want to say EDU University.

00:03:46.366 --> 00:03:51.632
And if there is a School, we want to say "the School of " 

00:03:51.633 --> 00:03:57.433
and join on the School name from the database.

00:03:57.433 --> 00:04:01.799
Again, the preview is showing us the result of the expression.

00:04:01.800 --> 00:04:04.566


00:04:04.566 --> 00:04:07.799
Now, let’s place it into the document.

00:04:07.800 --> 00:04:10.633


00:04:10.633 --> 00:04:15.799
And we need to manage the text frame overflow with some copy fitting.

00:04:15.800 --> 00:04:27.133


00:04:27.133 --> 00:04:31.966
We can also place the Content object here in the Agenda area.

00:04:31.966 --> 00:04:39.299


00:04:39.300 --> 00:04:43.900
In the previous tutorial, we created this School photo Content object 

00:04:43.900 --> 00:04:48.333
and an image only appears when there is a school selected in the database. 

00:04:48.333 --> 00:04:54.766
Our folder of image assets includes a general.pdf image that we need to display when that occurs.

00:04:54.766 --> 00:04:59.632
So, Right-click on the School photo Content object and select to Edit the rule.

00:04:59.633 --> 00:05:04.799
The logic is very similar to the last one, so I will swap to use the If logic. 

00:05:04.800 --> 00:05:13.600
Select the IsNullOrEmpty function. Select the School database field. And, we don’t need the comparison.

00:05:13.600 --> 00:05:20.100
Now, if the School database field is empty, then we want to use the general image. 

00:05:20.100 --> 00:05:24.166
Else, we want to use the School photo.

00:05:24.166 --> 00:05:28.132


00:05:28.133 --> 00:05:35.399
OK. Our job is done. Let’s create the print output again.

00:05:35.400 --> 00:05:41.666
I’ll print to PDF, and check the imposition settings. 

00:05:41.666 --> 00:05:47.099
This time there is no warning about missing assets.

00:05:47.100 --> 00:05:53.600
And here is our PDF output imposed and ready for print.

