 Hello, hi everyone. So I welcome you on Sanjay Gupta Tech School. So today we are going to have day six of this Appian boot camp and I have Ankit with me. So welcome Ankit on the channel. So like yesterday Ankit shared some concepts related to Appian. So today as well he will be sharing some more insights and like if you want to follow lots of content on this platform so you can follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram and Appian session tracker is basically available in this video's description so you can have it from there. Okay so over to you Ankit please proceed with the session. Yeah sure thanks Sanjay sir. So if you have you know if you want to see the recorded session so you can watch on this the chord mesh through YouTube channel as well where you will find all the recording sessions other than recording sessions you will get you know other knowledge sharing videos and all where you will get like the questions or some queries or like there are some no complex tasks and all that you can see. If you have any queries so we have one telegram group that with the name of the chord mesh row so if you're okay so you can put that query and we will resolve as soon as possible that okay. So in our last sessions like last two sessions we discussed what we learn about Appian's data types right like in build data type and custom data types like how we create the data type what are all ways to create the data types so we learn all about that. Now today we will learn about Appian data source okay so what is it in data source okay and why we use this and all. So in general terms data source is the place or is the tool where we store the data right or we store the information. It can be a database it can be a third party system like I can say SharePoint or other tool it can be a file like Excel file or PDF file or docket file or any type of file we can have okay so these are like data sources that we use. So in Appian also we can use any type of data sources okay to get the data to store the data we can use that. So in most of the cases or in general case we use you know database in Appian to get the data and to store the data other tools also we use but most of the time we use databases right so to connect with the data base okay we create data source in Appian okay so in general I know that in other tools and all and all you know that we can write simply write the select query or any other query or in the expression itself like if I want to write the select query for a particular database table I can directly write like select a start on this particular database table or if I want to insert I can write insert query or any other query I can directly write into particular tools expression editor but in Appian we do not write those query directly okay so to connect with the database or relational database I can say because Appian support relational database directly so to connect with relational database we create data source okay so in data source we have the connection string for the particular database and the database types okay and the credentials as well the particular database like the name user name and password also okay so in general I know that Appian support in this relational database like MySQL, SQL server, MariaDB, Oracle, PostgreSQL, DB2, Aurora, iSQL okay so Appian supported this relational database so how we create data source in Appian so we have one template here okay you can see the first column is name that is JDBC and we can add whatever name we have required okay we want we can add with the JDBC okay so in example also you can see JDBC plus example name so you can say if like JDBC plus Appian if I'm creating the database name with Appian so I can use that in username password I can put the username password of particular database and type I can select or whatever database I'm using like if I'm using MySQL I can use I will put MySQL if I'm using SQL server I will select SQL server and if I'm using MariaDB I will select MariaDB okay and same for others actually in connection string I put the connection string for a particular database okay so in database support I'm using one database schema so I will use that particular address of that schema here so like this we connect the relational database with Appian okay with the help of data source in India now the second is Appian data store okay and data store entity so first we'll learn about data store so like you can say you know that we are using suppose employee onboarding application on which we are working okay so employee onboarding application or employee onboarding I can you know consider as warehouse okay suppose so in employee onboarding there might be multiple tables or multiple containers that I can say like employee details is a container or is a table address of the employee can be other table or the employee you know that finance details can be the table attendance details can be table or leave details be table so there might be multiple tables or multiple containers in that warehouse in that employee warehouse okay so this warehouse we call as data store in Indian okay so data store is generally a container or you can say or you know warehouse okay that manage all the data you know entities or containers okay that we can see so in general to get the release you know tables related to particular application we create data store okay so now the how we create data store so to create the data store I will go to new okay and there is an option you can see data store okay I will click on this data store it automatically populate the name or the initial of the application you can see here okay now if I now I can put the name okay so you know need to require you know put the underscore or something you can simply give the name with space as well okay so I can put here just example data store is related to a particular database okay so if I'm there are there is a database like there is a mysql database and I'm using a schema APN so all the tables will be in that particular database and database schema okay so as we know learn like to in APN we connect the database with the help of data source okay so that wherever we need database we will use data source okay so here we will connect the particular data source that will be can that is connected with a particular database okay so there are multiple data sources that we created so we will select this one JDBC APN and one more thing like I'm you know we discussed in our first lesson that we have multiple type of APN environment one each APNs out of you know that cloud environment that is provided by APN and other like on three might server or you know self-hosted server so in APN you know provided cloud server APN give the database as well the mysql so MariaDB database now so the MariaDB database is out of the box database for a on cloud server provided by APN okay so in this case we have this you know pre-built data source for that particular database we can create more you know schema in the database but this is pre-built so if I'm creating new database schema in that particular database I have to create new data source but if I'm using the out of the box okay and already created it as basic schema by APN I can use directly use the JDBC APN Tomcat okay data source if I don't need to create a new data source in that case but if there is a requirement I can do and if there is a requirement to use a no external database that also I can do I can I have to just create a data source for that particular database and I can use the data source now I will create this particular data store thing like other artifacts here also we have to configure the security okay so we already know that what is there you know view viewer role administrator role editor role and deny role rights so in this case like if I'm using administrator then at that particular user will have all the rights to create delete okay the particular data store if I'm having editor right then I can create the data store but I cannot change the security of their particular data store okay if I'm having viewer rights then I can only view the data store if I'm deny the rights okay in that case I can I won't have any rights on that particular one so we already know like why we use the deny right so suppose there is a group to which we are assigning some rights but out of the group there are two members that we want to exclude right so those two members we put with the deny rights so you know that like there are 50 members of teams so all of the 50 48 members will have the right to get you know to work on this particular data store but those two users won't have the access so same life we assign the security to data store now you can see here we have one template window okay in this one you have the name of data source data store so you can update the data store name whenever you are you want okay there is the description of the particular data store okay so you can update the data store description also from here this is data source that we selected right when we were when we are created the data store but if you want to update you can update okay you can select any other data source also here so this is data store okay so as we know that data store is a collection of you know that manage management tool of the database table or I can say the collection of entities or tables okay that is data store so next is data store entity right so like we know you know that data store is a warehouse and that warehouse can be like employee and employee have multiple containers like employee table or I can say or a address table or a leave table attendance table okay financial details table so these we can say containers right so each containers is you know representing a table and the table can have multiple fields right like if I'm talking about employees so employee can have employees name employee ID employee salary employees age date of birth okay so employee container employee table can have multiple fields same like that address table when I also have multiple fields right and in the last session we learn like every you know to define the structure of database table in APN we create CDT right custom data type to define the structure so to refer the database table okay in APN we create database data store entity okay so to create a data store entity I will click on this add entity so like suppose I'm creating for AB employee details right that you know CDT we created yesterday now I have to select the type type is like data type and you know that we are using here database table or we are creating the entity for a particular database table right so we will use the custom data type okay that's right so here I will select AB employee details okay you can type here as well so now this AB employee details CDT is associated with this name okay or this entity the entity name and CDT name can also be different okay like I can simply use employee details here also okay that is not an issue but it's a best practice to use the same name now you can see here we have this entity so entity name is AB underscore employee details and its type type is like CDT CDT AB underscore employee details same like that I can create other entities as well okay as a as many as I need you know in the particular application so data store entity we create for database tables and database view okay we do not create data store entity for other database artifacts like stored stored procedure or triggers we do not create any data store entity we create data store entity for particular table or database view so now you have CDT right you have data source you created data store and now now we created data store entity okay now we have to verify so whenever I will click on this verify button it will check in the database okay and the in this database the database which is you know associated with this particular data source okay so it will check that this table exist or not in the database and how it will check the database table name because we are associated this entity with a particular CDT right and in CDT's XSD we define the database table name as well so database table name can also be different than this right it can be like AB underscore employee underscore details also right so it will first it will check the data base table name in XSD okay and then it will check that particular database table name in that database okay and if that table if that database table does not exist it will give you the error okay and suppose if the database table exist but some of the columns does not exist okay in the database table then also it will give the error or if there is any discrepancy like you know that if the type of the particular tables field is different or is something different okay it will give the error so now I will click on verify so it is giving error you can read the error one or more of the data entities cannot be mapped to the table structure in the selected data source okay data source is the connection between database and agent right please choose an option for creating necessary table or selected type that matches the existing table so here you can see that data source schema does not map the type mapping missing table so in database table we do not have this table okay so in database we do so in database we do not have this particular table okay that's why it is giving the error now if I want to check the DDL I can simply click here okay and it will download this now you can see here we are having the create table structure for that particular CDT or database table right so in that particular XSD okay this was for the XSD right sorry this one this one the XSD here we created the CDT field name and then database table names and all so it created the field name with the same names so employee ID that is integer not null automatically because in XSD we set like this right and company ID is integer but not a primary cure or anything that's why it is like this employee name was barricade to 255 so we are using like this and the primary is employee ID that's why primary so one way is like you can just copy this CDT you know DDL and you can run that DDL in the database okay and it will create the database table okay in the database and then you can come again and can verify okay so it will it will automatically verify it in that case because database table it exists now in the database right but there is other way also like now it does not have table so if I directly click on save and publish okay without you know going into the database or run the script I can simply click on save and publish and it will create the table automatically okay you no need to go into database and run the script it will automatically create the the script and it will create the table okay you have to just click on save and publish okay now the table is all you know created in the database so if I click again save and publish and I will click on verify you can see here entity mapping is verified okay so like this we verify or you know that we map that database table with data store entity okay if any of the error comes it will come in this one you know in this part and you can see the error you can go update the CDT or SSD okay to resolve the error and again map no click on verify to map if that particular table you know have you know CDT have some error or not if it have error it will again give you the you know error code here if there is one error it will verify it and you can use that okay so so wherever we need to use the database table right like to store the data into database table to pass the data from database table or like update the data into database table anywhere we will use data store entity in apn okay we won't use the database table directly but we will use data you know data store entity so this is the way to create a data store and data store entities now third is apn constants so what is constant in general constant are like no to store the static values right the values which won't change in future so like suppose I'm using another status status is like I can say draft so draft status will be always draft only right so this is a constant so like this we use constant okay so why we use the constant because suppose I'm using today I'm using a status in progress okay and I'm using that status in 50 different places right so if I do not use constant and if I hard code that value in progress in those 50 places okay and suppose on someday someone asked me to use instead of in progress like under progress okay or something different then I have to go to those 50 places and I have to change that value right but if I'm using constant okay and I'm repping the constant on all those five 50 places so I have to just update the value constant and it will automatically you know update the value for all those 50 places because those 50 places are referring the same constant okay I know need to go on those 50 places and update the value manually okay that's why we create one you know constants so how we create constant I can show you you have to go to new okay and you have to click on constant constant also have the same naming convention sorry the initials are same okay that application initials and in constant we use all letters in caps okay so suppose I'm using one address okay I'm storing one address here like I can say employee status okay acting so all value will come in care okay with underscore okay so before employee we have underscore after employee we have underscore and all letters are in cap right so in constant we use all letters in caps only okay so in description whatever contains employee status here we have type okay in type you can see we have multiple values you can create a constant of application type boolean type connected system type that we will you know learn in our next sessions data store entity type constant also we can create date type constant we can create date and time document of our folder email address okay folder group type knowledge center number decimal number integer process model record type report site task report so we can create any type of constant here okay so suppose I want to store that integer value I will create integer type of constant so in this I can store numbers but if I want to store the text type of value sorry so it will create you know the text I will create the text type of constant so in that one I can store like in progress or in other text so like that I can create the constant okay now there is one you know if I want to store the multiple values in one constant I can create it as Eric okay so now I can add multiple value like I can store other status also like drop I can store more like active okay I can store result so I can store as many as value I want I can okay I can store in that particular constant because it's an array type of constant okay if the single type of constant I can store only one value okay so like this we create the constant and constant also we store in rule type of folder okay so in our first or second in our second session or first session we learn about folders right so we have my three type of folders one is document or knowledge center other is rule folder and you know third one was process model folder so constant and other rules we store into rule type folder only okay you can not store constant in process model folder you cannot store constant into document folder or knowledge center okay you have to store constant into rule folder only okay so now you can see here we are storing into rule folder okay this is rule folder if there is an only rule folder from here you can create a new rule folder as well okay but now we have so we won't create a new folder okay but if suppose if I do not have I can create okay if I want to use a different rule folder then also I can select okay different so like this we create the constant okay so now we created constant and if I want to use this constant you know anywhere in that particular you know that artifact or anywhere else I can simply use this constant okay so for to use this constant I will use this prefix cons c o n s and okay and then I will use the name of that particular constant okay so like this I will use this particular constant so and suppose if this constant have multiple values like this constant have in progress draft active resolve and I want to use only draft okay so I will use the particular index so you can see here draft is on second index so I will use second index in this square bracket okay and it will return me the value of this particular constant you know constant on second index I want to patch for first index I will use one if I want to use third if I will use third but you know that this constant have only one value okay and if I am using here five but this constant do not have a five values right you have only four values so in that case it will break and it will give us it will give us the error okay so like this we create the constant and just now we created data store entity right so for the data store entity also we can create the constant like this a b like entity I can see and it was for employee details okay so generally we use this naming convention because we are using entity so we put this pretty you know in a start the entity you can use put the ds also or dse also because dse also data store entity okay so whatever we are using a particular application it it must be consistent okay so whatever you want you can use here you can see contains a b employee details data store entity right so for you know to you store the data store entity value I will select the type as data store entity so you can see here we have one type that is data store entity so I will select this one now in this one I will select the data store so you know that our data store is you know that a b employee details so I will select that particular data store and from the data store I will select that particular data store entity so I can show you so this is our data store right our data store is a b employee application so first we will select a b employee application in data store drop down and then I will select this data store entity before it so in a particular data store we can have multiple data store entity okay so we are we create the constant for a particular data store entity so I will select that data store entity from here so like this we create the constant for a data store entity okay same like if you want to create a data type of constant then also you can create if you want to create want to store the folder okay so you can create the folder type so you know that we have one folder that is a b artifacts so you can simply use this a b artifacts okay so you can create folder type of constants as well okay like if I want to create the bullion type of constant so bullion will have only true or false value so I can give any of the value okay in this one so like this I can create a bullion type of constants so wherever we need static values okay and we think that in this particular value I can use in multiple places so we use we create the constant and that constant we refer in those places we do not directly hard code the value okay so like I won't directly hard code true on those places instead of that I will use this constant same like you know that we created a constant for the status so wherever I need this in progress status I won't hard code this value on this on that code but I will use this constant and this particular index okay like first index so like this we create the constant and these are the best practices and then you can answer to get the constant okay there is one more thing that is environment specific constant so what is environment specific constant that I will we will discuss so you can see here we have one you know checkbox or environment specific so suppose we are using multiple environments like there is one development environment and there can be a you know production environment where the in real time the application will be live okay and and users will use there might be other environment also right like environment for testing purpose okay and environment for UAT purpose so there might be multiple environment so some of the constant value might be different in different environment I can see like the status status will be same on all the environment right in progress status will be in progress on there in progress you know will be on production on test or UAT right so on all environment it will be same but sometime like if I'm you know storing the credentials suppose I'm storing the credentials and that credentials is can be different for every environment can be different for a test environment or a site environment can be different for a production environment right or suppose I'm using one storing one URL okay and text format that URL can also be different right on the environment the URL can be different on test environment or UAT environment the URL can be different so whatever constant that's value might be changed on different environment we use as environment specific okay and the constant that you know that's value won't change on environment is you know environment to environment we don't you know create the environment specific okay so in that case we just unchecked the this checkbox but if you want to create the environment specific constant I have to just click on this checkbox okay and in that case it will create this constant as environment specific okay so this constant will be dependent on environment okay so these are all about constants so today we learn about data sources okay and what all data sources apn support and you know that how we connect database with data source okay then we learn about data store like how what is data store how we create the database data store and what is data store entity how it is related to CDT and how it communicate with the database table that all we learn and then we learn about the constants like what is constant why we create constant what naming convention we should follow how it security works okay and how we use the constant in other places like you know we check that we will use that we use the con cons and then the object name or the constant name okay and what and then we learn about environment specific constants okay so these all we you know learn in today's sessions okay so if you have any query okay you can ask now so we you know we will reply and if you have any query in future like if you are watching the recorded sessions so you can comment or you can post that query on you know our telegram link or you know you can post this on this email ID as well like training at the reddeckfordmestro.com so when you know when whatever career you can post and we will reply you on that particular one so this is all about you know today's session so in next session we will learn about more features of apn so thank you everyone and i want to know what to say okay so thank you so much Ankit for sharing insights about apn so guys please share reviews or feedback and if you have any doubts so we have telegram groups so you can ask your doubts here and we'll be having next session next week so hopefully we'll be having instances till then so that you can do some practice okay so thank you thank you Ankit once again so see you guys and we'll we'll see you next week thank you thank you thank you