 Hello everyone, I am Sanjay Gupta, I welcome you on Sanjay Gupta Tech School. This is day 4 of Appian Bootcamp and I have Ankit with me. So welcome Ankit on the channel and like as you are delivering lots of quality content and knowledge to the audience like on daily basis. So far we have completed three sessions and I hope in this session also you will be sharing some new things with the audience. So let's start with a session and before that I just want to request you please follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram because other than Appian you will find lots of information there. If you want to know everything about Appian so the session tracker link you can find in the video description. So this is about this channel and now I hand over mic to Ankit. So Ankit also have one dedicated YouTube channel for Appian so over to you Ankit. Let's start with the session. Thanks Sanjay sir. So if you want to learn more about Appian you can go to the code master the link is in the description and there you can find the previous sessions as well and other query questions or some small sessions. So you can find everything there and there is Telegram group as well with the name of code master. So if you have any query you can post there or you can. So we will look and we will provide you the solution for that particular. So in our last session we discussed about folders like how folders work, what is the Appian folder and how many type of folders are there and what we have the discussion depth. So today we will discuss about data types in Appian. So first is like what is Appian data type. So in general what is data type. So suppose there is information and each and every type of information has a category. So suppose like I am asking someone his or her name so they can tell me that my name is Ankit. So Ankit is text same like if I am asking someone age. So age can be like integer or decimal. If I am asking someone the date of birth so date of birth can be date type. So each and every information have a type. So in Appian also we have similar data types. So to store the particular value we create some variables and each and every variable have some types. So like other language Appian also provides some built in data types. Built in data type means so these are the out of the box data type that you can directly use. You don't need to create these data types. So there are some examples. There are many more but some of the examples are here like text, number integer, number decimal, date, date and time, Boolean. So if I want a name to store. So I will use text if I want to store some integer type of value like age or like postal code or something. So I will use number integer if I want decimal type like salary or some person or some calculation type of thing. That you can be accepted decimal. So I will use number decimal. If I want date type like date of birth so I will use date type. If I want to capture date and time like I can say like today's date and time or current date and time. So in that case I will use date and time. If there is a question that answer can be yes or no. So in that case I will use Boolean. So these are some of the examples of built-in data types in India. But APN provide many more built-in data types that we will use when we work on application. So how we can implement built-in data type or how we can use built-in data type in an expression or interface or any other artifact. So this is one of the expression editor. We will read about this in our next session. But for today we will just learn how we use the data types in this one. So from right side you can see here we have rule inputs. So I can create a rule input. Rule input is nothing but a variable for a particular expression. So from here I can create rule input. Suppose there is a rule input employee name. So you know that employee name can be only text. No one have the name in number integer or decimal. So I will use text. If I want someone's age. Age can be like integer. Generally we use integer. We can use decimal as well. But number will be generally use integer. If I ask about salary. So salary can be decimal as well. So I will go here in type. This is data type. I will click on this drop down and you can see these are some of them out of the box data type that APN provides. So for salary I will select number decimal right. If I want to capture date of birth then I will use date type right. If I want current date and time or time stamp. So I will use date and type right. So like this we can you know provide a type to a particular variable okay. So that is the way. Now suppose there is an expression. These are some functions that we will read. But for now you can just see. So this is age okay. And age is number integer right. So it is giving me error right. Because it will accept only integer. Because it's type is integer only right. So it will give me error. So I can only put here integer value. Okay. This is text. In this one I can put the text. I won't give any error. Similarly in date of birth okay. I can give date only okay. Like this. In date and time you can see here date and time both are available. So I can select date as well as time also. But in date type of variable you can see we have only date. We do not have time okay. In salary I can put decimal also like 1.5, 1.4 something like that. I can put here okay. So these are built-in data types and how we can use it okay. So we can use like. We can create a variable and that we can provide a data type to that particular variable okay. So like this we can create. So later on whenever we will work on this you know expressions or interface. We will learn more about this like how we can use this. Like you know that APN provides some function. So if you want to add something you can use. But that we will learn whenever we will work on expression rules okay. Now these are built-in data types right. Where you no need to create APN out of the works provided. Now come to the custom data type. Custom data type is a data type that we will create okay. APN does not provide this out of the box. We have to create the custom data type okay. And custom data type we create with the help of built-in data type. So suppose there is address okay. So some address can be like street okay. City, country, postal code okay. So these are the combi. So address have multiple sub fields right. So for address we cannot take data type as text. We cannot take data type as integer. Because it is the combination of multiple sub fields okay. So like postal code, postal code can be integer right. And street name can be text okay. So it will be the combination of built-in data types. So to create the custom data type we use built-in data type okay. And now uses of custom data type okay. So organizing the related data. So we just read about address okay. So address is each and every field like street, city, country, number or postal code all are related to address okay. So to organize this type of related data we use custom data type. If suppose there is employee okay. And I am storing employee details. So employee have employee's name, employee's age, employee's number, employee's address everything is related to employee okay. So to organize the similar type of data we use custom data type okay. So for that purpose we create custom data type. Second is reusability. So suppose address okay. And I want to use address in multiple type. Like address can be for an employee address can be for a customer, address can be for a particular office or an organization okay. So address we can use multiple times okay. So we can create a custom data type and we can reuse wherever we need the address okay. So its purpose is to reusability as well okay. Third is define structure of a database table or database view okay. So database table. So database table also have multiple data types right inside this. So suppose in database table I am creating a database table that is for employee okay. And employee data table have employee name it can be text or where care employee ID that can be primary key and integer or it can be auto incremented as well. There can be employee salary it can be in decimal okay. So there is a table. So define the structure of database table we use CDT in APN okay. So if for the employee table if you want to create a CDT you will create and we will add this employee related table you know fields that we are using in database table. Similarly for database view also because database view is also a virtual table right. So for database view also we create CDT okay to define the structure of that database view okay. So these are main three purpose to create custom data type okay. So how we can create custom data type in APN. So there are four ways we can create from scratch okay. So you can provide the template we will go through that. Then if there is existing custom data type we can duplicate that okay. And we can duplicate the existing one and we can do some changes whatever we are needed okay. If there is already database table or database view exist we can use the database table and database view and we can create the CDT using that CDT sort form of custom data type okay. And for the import XSD, XSD is like XML schema definition okay. So we can create the CDT using XSD as well okay. So now we will go through one by one. So first create from scratch. So similarly we will go here okay. And we will click on data type to create custom data type okay. And you can see here we have four options. Create from scratch duplicate existing data type. Create from database table or database view and for the import XSD okay. So first we will create from scratch. Now you can see here we have one term that is name space. To name space is nothing but a URL that is used to uniquely identify a particular category okay. Category means like you can say it is a compartment. So in compartment we use the similar type of data you know. Data like if I am creating an application for employee onboarding. So to employee onboarding we will create same name space. Because everything there can be multiple table for employee onboarding right. Employee details, the address details or any other details we have. We will have multiple tables and we will have multiple CDT's. But to create a container or to create a category we will use employee onboarding for that okay. So they say name space. Now it will automatically take the application initial as we discussed last time as well. Now you can give the name. So suppose I am creating for add or I am creating for employee okay. So to store the employee basic details I can create a CDT okay. I have put the name and in name we cannot put space over any special characters okay. It will give the address. So we have to just use we can just use underscore but we cannot use any other space and all. Now I have to click on create. You can see here APN provided the template okay to create a CDT. So its name is AB employee basic details that we provided and now I can add fields. So suppose I am creating a CDT and I am adding cost field like employee ID. So employee ID can be number ID right. Now employee name can be text right. Similarly I am adding age integer. I am adding date of birth. You can give any name but its best practice to use KML casing okay that can be receive. So these all are you know built in data type only right. And with the help of built in data type we are creating custom data type okay. So its like a structure or a you know collection of similar data type or data. So I have to simply click on see it changes and CDT is created okay. So you have to just add fill whatever fills you are needed and CDT will be created okay. So it is very easy to create from scratch. Suppose you have table for this particular CDT and you want to match its table. So and this particular field is primary key in table. So you can go here on this key sign click on this one and you can make it as primary key okay. And if you want that primary key to auto generated value. So suppose first where is one so it will automatically take second value as two okay. So for that you can click on this check box okay and you have to just click on save. So like this you can create the CDT. If you want to give the you know limit of length of the value particular value. You can give like default is two four fifty five but you can increase or you can decrease as well. So in employing you want only thirty character maximum thirty character. You can give thirty okay like this you can update. So this is the way to create a CDT from scratch okay. There are some you know point that we should discuss. So first is CDT name that we already discussed that CDT name is this is the URL or a virtual container okay. Or virtual category categories okay to create a particular type of CDT. Now CDT UUID universal ID okay. So universal ID to identify a particular artifact in APN we use UUID. And that will be unique across the environment okay. So generally in other artifact like we created last time group or folder APN automatically create UUID okay. That is a alphanumeric key. In CDT the UUID you know is the name plus name space okay. So with the similar name and name space I cannot create other CDT. I can create with the same name I can create with the same name space. But with the combination of name and name name space I cannot create. So suppose if I want to create the CDT with same name and same name space it won't allow me. It will give me the error okay. So we cannot create that. So to uniquely identify we use name plus name space. So like two CDT can have same name and two CDT can have same name space as well. But the combination cannot be same okay. And once you created CDT name and name space it cannot be changed. You know then that in other artifact that we learn in last in our last sessions like group and folder. We can change the name also right by going to the properties. But in CDT you cannot change okay. This is coming in read only right. And name space is also disabled or read only. So you cannot change. You can only change the description. So once you created there were there weren't any option to you know change the name. You can only delete and recreate the CDT if you want okay. But you cannot change the name nested CDT. So nested CDT is a format where you can instead of decimal like you know that suppose I'm adding one field address okay. And you know the address is also a structural data type right. So this address can have all also have the fields like street or country or you know postal code. So address also is structural data type. So address will also have CDT. So we can you know use the custom data type also here okay. So I can use the address CDT also instead of built-in data type. So that we call as nested CDT okay. So we can use CDT inside other CDT. And there is other option duplicate existing data type okay. So suppose we have this data type and I want to create. Sonkit there is one question and Chit is asking can you please also tell limitations or best practices to consider when designing custom data types. Yes. So if you talk about best practices. So first you know that you have to define the length okay. So suppose if I'm defining 4000 okay. And that is employee name employee name cannot be 4000 length type. So it is the best practice to define the length. Second is naming convention okay. Naming convention is like you know that employee ID. So we generally use camel casing some you know in some organization we can use lower camel case in some organization we use upper camel case. But we should use you know camel casing in this case okay. If you talk about limitations. So in terms of limitations you know that CDT CDT have multiple use cases but that one limitation you cannot change the name right. So for that if we in some of the use cases there is a requirement to change the name okay. You have to delete and recreate and if you're deleting the particular CDT and but you are using the CDT in multiple objects already okay. So in that case you have to go to those objects and manually change that CDT okay. There is no any other way. So we have to take care whenever we are creating the CDT that it you know already that it won't change the name okay. So whenever we are getting we have to take care of this particular thing and as well as name space also okay. Because name space and name are part of UUID or and anything that is part of UUID cannot be changed in APN. Either in interface either in expression rules or any other artifact we cannot change the UUID okay. It will be fixed but in other artifacts UUID is created by APN so we no need to take care okay. But in CDT UUID is the combination of name and name space that's why APN does not allow to change this okay. Otherwise there can be problem right. So this is one of the no limitations and these are the best practices that we should use. But suppose if you are using the particular CDT in a database table okay. So in CDT we give the name of CDT field and database field that we will no discuss in our next session whenever we will discuss no CDT from XRD. So we will we give the CDT field name and database field name as well okay. So sometimes CDT field name can be different and database field can be different like employee ID is the CDT name here right. Where E is in cap and ID also in cap. But in database field we have the name as employee underscore ID okay. So we have to define both name in CDT for CDT field name and other for table field name. If you do not define that particular field name so APN automatically create that field in database table okay. APN won't match that particular field with database field name because you know you do not define that you know in one of the case you did not define the database field name. APN will think that there is no any field exist with this particular name and APN will automatically create that one okay. If you do not give the size of field so for text APN automatically will take 255 okay. And suppose in Boolean case if you are defining the Boolean in CDT and you are not defining the database field type. So it will automatically take tiny int okay. But if you want you know in Boolean in CDT and like string in database you have to define in XSD okay. So you have to define everything in your CDT or your XSD like that we call it JPA annotation here okay. So these are the best practices that we should follow whenever we are creating the CDT and there are some limitations that also we have to take care okay. Whenever we are creating the CDT so that we know you know in future we know need to change that particular CDT name one name in case other things we can change. But the name and name is best we cannot change okay. So these are best practices and limitations so is it fine until. Yeah I think Ankit we can move ahead if he will be having more questions so he can ask. Yeah sure so the second type okay to create the CDT is duplicate existing custom data types okay. So like we have this AB employee database okay and I can duplicate this one. So for duplicate I have to again go to the same new tab okay. I can have to click on data type and this template will open okay. From here I can select duplicate existing data type okay. So now you can see we have an option data type to duplicate okay. So here I will put the existing data type that we already have okay and it will show me this AB employee database okay. This one is already you know we have created and you can see name space is also coming. So you can identify like if I am selected correct or not. Now I will select and now you can see here name space is automatically coming name is also coming okay and this is description. So here you can see name and name space both are same okay. So if I create this it will give me the error okay that this type with this name already existing exist in this name space okay. Please enter a unique name. If I change the name space this error will automatically remove because either one of them in unique okay. Now if it is same and if I change the name of this one then also it will remove the error okay. So suppose I am creating a 3DT okay with the employee address. So I can simply put contents employee address and I have to just click on create. Now you can see this you know it created the 3DT with the same name. If you want to change the fields also you can change like in address we do not want employee ID okay. We want like address ID so I can simply add it to this one. I want employee ID here just to make the relation so I can add this one here. I want street so I can add I want state name so I can add one country I can add here I want postal code. If I want to delete I can click on call to delete it okay. Now I want postal code in this one also you cannot give space okay. You have to give in single string. If you give a space it will give you an error like postal code I can say number integer. And in this one also it is primary if you do not want to create is a primary key you can simply remove okay. And I have to just click on save. So like this if you know that there is one CDT and other CDT is similar to first CDT okay. In that case we can use this feature okay of the APNC. Third one is create from database table or database view okay. So suppose there is already database table exist in a database okay. So we can use the database table and we can create the CDT and it will automatically take the you know the format or the fields from that particular database table. In similar way you can go to here okay and you can select the create from database table. So in this one it will ask you to select the particular data source that is you know in our case 80 JDBC APN that is a you know data source we will read you know about in next session. But data source is the connection between APN and database okay that we create. So in this one we will select this JDBC APN toolkit and there is existing table that is DM account document that will select and it will create the database. Sorry CDT automatically okay and we can update that. So like that we can create the CDT by using the database table as well okay. That we will read more about whenever we will you know create a database table you know and we will create the particular CDT using the database table. But for today we can simply know that with the help of database table also or view also we can create database table you know CDT. In that one we have to just select data source that we want okay. Like you know that APN can be connected with multiple database or as many as database we have connected we can create the data source okay. So data source can also be multiple. APN provided out of the box database that is MariaDB that have one database data source that is JDBC APN toolkit. But in some cases I do not want to use that APN existing you know database or the out of the box database MariaDB. I want to use my own database that is MS SQL or Oracle then I have to create a different data source for me okay. So I can use the data source here and I can use my table that existing that particular database okay and I can create the CDT okay. So this is the third way of creating the CDT okay. So these are very you know simple way to create the CDT. You do not need to do anything APN provide the template you have to just you know complete the template you have to just you know add your fields. You know follow the best practices and you know put the particular data type and it will be created. So it is very easy to create a custom data type in APN that we can use in future to organize the data. If I want to use it you know define the structure of the database table then also I can use. I if I want to write in database or you know to take the input from user in APN that in that case also I can use the CDT that we will learn whenever we will learn. You know learn about APN interfaces that how we can take the input from user and how we can put those input into you know CDT and how we can store that CDT data into database okay. That is the complete process that we will learn in our regular sessions for some you know next sessions but today we can only you know work on how to create the CDT and from this first three methods. Create from scratch duplicate existing data type create from database table or view. Fourth is import XSD that we will learn in our next session but XHD like you know Istima definition language of XML. So in that one we define the database you know template in XML file we define the name of the CDT we define the name of the table that is associated with the particular CDT. We will define the columns filled name filled type or the column configuration in table like what is the type of database table fill name and everything we will you know create the particular XSD template and then we will import that XSD template to create the CDT okay. So this is the fourth way to create a CDT that we will learn in our next session. Now for today we will we have learned about you know three methods okay so whenever we will have an environment we will practice on that. So we already requested you know for that even environment and we are waiting so all the requests are in queue so most probably in next week we will get the access so we are communicating with APN for that and whenever we will get the access we will provide you. Ankit there is one more question so Ankit is asking can custom data types be used in interfaces process models or rule design object across the application. Yes yes we can use okay you have to create CDT or custom data type once only and you can use across the environment okay. So there are multiple applications okay and each application have some interface some expressions like business logics or workflow like process model you can use anywhere that particular data type there is no any limitation. Okay so Ankit if you are online so I think Ankit answered your both the questions. You know that if you have any query you can know we can discuss on this call if you have you know learning from the recorded video you can if you have question you can put the comment on video or you can go through that you know our YouTube channel and you can find some other questions as well there. And then also if you have questions so you can put those queries in this email ID training at the code mesh.com or you can put that query on telegram channel as well. So we have link in description so you can go through and you can learn okay whenever you have question you can ask so that's all about. Thank you Ankit for wonderful session so I think you shared lots of new insight about Appian and guys those who are live if you have any question so Ankit already told you like different platforms are available you can ask questions. And if you are watching the recording and if you are struggling and want to discuss things so I think in my opinion this email ID or telegram group will be the best way if you want to communicate with Ankit about the doubts. Okay with this note like this week we planned only two sessions those are already delivered. So next week also we'll be having two more sessions and maybe hopefully we'll be having the Appian environment so that you can start doing some practice. Okay so I think we can end the session Ankit so thank you so much for sharing the knowledge and guys see you next week with some more Appian related stuff. Thank you everyone.