Fields
Fields in PWR Apps represent what the columns represent in relational databases. It can store data values that are required for a particular object in a record. Fields can store different types of data.
There are 3 types of fields:
(A) Standard Fields
(B) Audit Fields
(C) Custom Fields
Standard Field:
Name:
Name is a standard field in an object this gets created at the time of the creation of the object.
Tags:
Using this field the user can give a tag to the record of an object from the list of values. Users can create new tags at run time as well.
Standard and Audit fields cannot be edited or deleted.
Audit Field:
Record Id:
A record id can help you identify a record in the database. Each record has a unique id which is known as the record id. It is system generated and cannot be edited or deleted.
Object Type:
We have a common collection (or object) for all the records created under the custom object. Object type contains the object name (custom object name) for which the particular record is created.
Instance:
This field contains the instance for which the record is created.
Owner:
Objects have an owner Id field that is a reference to the user who owns that record. Ownership is an important concept that affects the security model and has other implications throughout the system.
Created By:
This is the reference to the user who created that record.
Created On:
This field has a date and time at which the record is created.
Last Modified by:
This is the reference to the user who modified the record last time.
Last Modified On:
The last modified date refers to the last time a document or media file was modified. This information is gathered from metadata within the document or from the website's servers.
Is Deleted:
Is deleted field is used to keep the record of deleted records. If the user deletes any record from the account then with the help of the “Is Deleted” field we can keep the track of deleted records in the database.
The deleted records do not get permanently deleted from the database unless TTL (Time To Leave) field is applied.
Deleted By:
Deleted by field is a built-in (non-custom) audit field used to record which syncing user deleted a record.
Deleted On:
Deleted on is a field where date refers to the last time a document or file was deleted.
Is Test Record:
The field test record is used by the developer to maintain the test record.
Erase On:
When any of the records have been deleted from the org it gets reflected in the erase on the field. The restored limit for the erase on the field is of 30 days.
Is Published:
Once you publish an object, you can select which individual fields on that object are published. For standard objects that are published, a default set of fields is automatically published.
Is Manageable:
Is Manageable is a Boolean field of metadata object that is used to make an object is managed or
un-managed.
Custom Field:
Custom fields can be created on standard or custom objects. they may or may not be required.
The custom fields are added by the administrator or developer to meet the business requirements of your organization.
When we create a custom or standard field, we can decide what different type it should be (such as number, text, date, pick list, etc).
How to create a custom field:
From Profile, go on “Setup”
Click on “Schema” and select a “Objects” option
Click on any Object where we have to add the fields
Click on “New” and select the appropriate data type to create a field
There are 26 data types that we can use to create a different field:
Address:
A compound data type that contains address data. This field includes a sub-fields are as follows:
Country: The country detail for the address.
State: The state for its territory, the area of jurisdiction, or geographic boundaries for the address.
City: A city is a place in which people live and work; its detail for the address.
Street: The street address includes the address of a building, typically comprising a house number, and street name detail.
Postal Code: The postal code refers to the code in the post office number of the postal code system for the address. Postal codes are usually assigned to geographical areas.
Array:
An array is a systematic arrangement of similar objects, usually in rows and columns. Arrays are used to store multiple values in a single variable, instead of declaring separate variables for each value.
Object:
The object is a field, where variables are saved together within an object, we call them fields or member variables.
Lookup:
A lookup relationship essentially links two objects together so that you can “look up” one object from the related items on another object. Lookup fields allow users to associate two records together in a relationship but have no effect on deletion or security.
For example, a user can associate a contact record to an account record using the Account Name lookup field. When users edit a lookup field, they need to find the right record to associate.
Lookup relationships can be one-to-one or one-to-many or many-to-many
In a one-to-one relationship, one record in a table is associated with one and only one record in another table. For example, in a school database, each student has only one student ID, and each student ID is assigned to only one person.
In a one-to-many relationship, one record in a table can be associated with one or more records in another table. For example, each customer can have many sales orders.
A many-to-many relationship occurs when multiple records in a table are associated with multiple records in another table. For example, a many-to-many relationship exists between customers and products: customers can purchase various products, and products can be purchased by many customers.
Checkbox:
A checkbox (Tick box) is a graphical widget that permits the user to make a binary choice between one of two possible options.
If the user may have to answer “Yes” it’s ‘Checked’ or “No” its ‘not Checked’ on a simple yes/no question. We can set a default value as either yes/no.
The Checkbox field has feature accessibility like may or may not be Read-only or Sort-able, Create-able, or Editable.
Currency:
Currency fields contain currency values. The currency field exists only for those organizations that have enabled multi-currency support.
The currency field has feature accessibility like may or may not be Required, Select-able, Read-only or Sort-able, Create-able or Editable. We can choose the appropriate currency type from drop-down whichever is listed and may apply the limitation to be taken as minimum or maximum on the currency.
Date:
Allows users to enter a date or pick a date from a popup. Use the functions DAY( date ), MONTH( date ), and YEAR( date ) to return their numerical values. This field will store the text version of the date Field in dd/mm/yyyy format.
A date value stores a year, month, and day. A date field is great for showing the birth date.
The date field also has feature accessibility like may or may not be required, select-able, read-only or sort-able, create-able or editable
Date/Time:
A Date/Time value stores a year, month, day, and time. The time is stored as GMT, but displays in the time zone of the user viewing it. It’s important to keep time zone conflicts in the back of your mind as you work with Date/Time values in formulas.
This field comes along with multiple dates and time formats. We can pr-defined date as minimum and maximum by applying validation.
Duration:
The duration field type is a numeric field type intended for use with time duration measured in hours, minutes, seconds, or milliseconds. Depending on the format of the duration field, the values are either stored as an integer or decimal representing a number of seconds.
Time:
The time type is useful for time management, event planning, and project management.
You can select the time field type when you create a custom field. The time type is a timestamp without the date included.
Use the time field type when you require a time of day that isn’t specific to a single date. For example, use it to display business hours, or if you want to compare times of the day to calculate a duration.
Image:
Image Field is a file field with uploads restricted to image formats only. Before uploading files, one needs to specify a lot of settings so that the file is securely saved and can be retrieved in a convenient manner.
Image Field is used for storing valid image files in the database in jpg, jpeg, jpg, SVG, and gif format. Also, allowing multiple sources to use like attachments, records, and URLs.
Email:
This is a separate field to record email details from a user, called the E-mail field data type field. This field can validate if the given email Id is valid or not.
This field allows users to enter an email address, which is validated to ensure proper format.
Integer:
Integer fields are fields in which you can make number entries and if required also use the values for calculations.
The minimum value permitted. The user can enter a value that is equal to the minimum value. Or else, the user must enter a value greater than the minimum value.
The maximum value permitted. The user can enter a value that is equal to the maximum value. Or else, the user must enter a value less than the maximum value.
The default value must be between the minimum and the maximum value.
Double:
Double is a field where we can make number entries with decimal places.
The user can enter a value that is equal to the minimum value. Or else, the user must enter a value greater than the minimum value.
The user can enter a value that is equal to the maximum value. Or else, the user must enter a value less than the maximum value.
The default value must be between the minimum and the maximum value.
Multi-select:
The multi-select picklist data type field contains many of the data available on the list. This pick list can allow users to select multiple data from the list.
Multi-pick list fields allow you to select multiple values on your records for various use cases. You have the ability to define values during the creation of the field and after creation, you can continue to add and remove other values.
Percentage:
The Percent is a field that allows users to enter a percentage number as a decimal. The percent field type is a field type designed to hold numerical values formatted as a percent. The values in a percent field are all represented as fractions of 100 with the percent sign.
e.g. the number. 75 in a percent field is represented as 75%.
Phone:
The Phone field enables your users to enter a valid international phone number. The input area of the phone field contains a drop-down menu to select the international country calling code. An input box, with indicative text, to enter the phone number.
Select:
The select field offers a selection of options available for specific fields in an object, such as a list of regions. Users can then choose a single value from a list of options rather than make an entry directly in the field, which cuts down on errors and helps keep data clean.
Text:
Allows the user to any combination of letters and numbers.
They typically appear in forms and dialog. Text field component design should provide a clear affordance for interaction, making the fields discoverable in layouts, efficient to fill in, and accessible.
Tags:
A Tag field on a content type allows content contributors to label the content with keywords (tags) as it the content is contributed. Each Content Type can only have one Tag field. You can tag any field-value pair directly from the results of a search.
Radio button:
Radio buttons are arranged in groups of two or more and displayed on the screen as, for example, a list of circular holes that can contain white space (for deselected) or a dot (for selected). Each radio button is normally accompanied by a label describing the choice that the radio button represents.
The choices are mutually exclusive; when the user selects a radio button, any previously selected radio button in the same group becomes deselected (making it so only one can be selected). Selecting a radio button is done by clicking the mouse on (or touching the screen over) the button, or the caption, or by using a keyboard shortcut.
Text Area:
The text area field represents a multi-line plain-text editing control, useful when you want to allow users to enter a sizable amount of free-form text, for example, a comment on a review or feedback form.
We can customize the field by applying the validations like maximum & minimum limit, the number of rows & columns, and the direction and pattern of the field area.
Rich Text Area:
In the Rich Text Area, with the use of a toolbar users can format the field content and add images and hyperlinks.
The toolbar allows the users to undo, redo, bold, italic, underline, strikeout, add a hyperlink, upload the image, modify alignment add a numbered or non-numbered (bulletin) list.
URL:
The URL field enables your users to enter a URL (Uniform Resource Locator) - the link to a website or web page.
You can edit the field properties and set a default pattern for the URLs of the entries of a specific content type.
Merge Text:
Your template content can store fields that show field values from different objects. These merge fields are automatically updated in your content when the referenced field is updated on the other object. This process is useful if you want template content to reflect changes made elsewhere in your org.
Formula:
The formula field is used to calculate custom fields, validation rules, flow logic, etc.
Formula fields are read-only fields that automatically calculate a value based on other fields or a formula. any change in expression or formula will automatically update the value of the formula field.
A formula field can reference the value of another custom or standard field using a merge field.