- Getting Started
- Demo apps
- How To
- Build Your First App
- Build a Mobile-Friendly App
- General User Experience Guidelines
- Use Master Detail View
- Use Document Viewer
- Use Count With Choice Set Values
- Use Selected Values From a Table
- Embed Apps
- Embed Maps
- Hide Containers Using a Button
- Include MailTo Links
- Include Star Ratings
- Set External Context
- Work With Data Source and Value Bind
- Use the Send Interim Result Activity
- Public Apps
- Notifications
- Using VB Expressions
- Designing your App
- Events and Rules
- Rule: If-Then-Else
- Rule: Open a Page
- Rule: Open URL
- Rule: Close Pop-Over/Bottom Sheet
- Rule: Show Message
- Rule: Show/Hide Spinner
- Rule: Set Values
- Rule: Start Process
- Rule: Upload File to Storage Bucket
- Rule: Get File From Storage Bucket
- Rule: Reset Values
- Rule: Create/Update Entity Record
- Rule: Delete Entity Record
- Rule: Add to Queue
- Function: And, Or, Not
- Function: Concat
- Function: Contains
- Function: Count
- Function: EndsWith
- Function: If
- Function: IsBlank
- Function: Guid
- Function: Length
- Function: List
- Function: StartsWith
- Function: Sum
- Function: Sort
- Function: Now
- Function: Today
- Function: Time
- Function: Year
- Function: Month
- Function: Day
- Function: Hour
- Function: Minute
- Function: New
- Function: Lookup
- Function: Filter
- Leveraging RPA in your App
- Leveraging Entities in Your App
- Leveraging Queues in Your App
- Leveraging Media in your app
- Leveraging Actions in your app
- Leveraging Connections in your apps
- Application Lifecycle Management (ALM)
- UiPath First-Party Apps
- Basic Troubleshooting Guide
Using Data Context
For more information related to entities, see the following guides:
Before starting this example, make sure that you have the proper permissions from Data Service. For more information, check the Data Service - Managing Access page.
For the purpose of this example we will use an entity called Customer with the following fields:
- Address
- Address 2
- City
- Name
- Phone
- Plan
- State
- Postal Code
- Open your already existing application or start a new one.
- Create a new table.
-
Add an entity to your app by clicking the Add any icon from the top of the canvas and selecting Entity.
- Bind the newly-added entity to the table by adding it in the Data Source field of the table.
-
Add the following expression in the Data Context field of the main page:
=Lookup(Customer, [Name, "=", "Demo"])
. - Add a new textbox control.
-
Add the Name data context in the Default Text field of the textbox control. Preview the app and the textbox should display the text configured using data context.
Data context can only be used to update an existing entity using the Create/Update Entity Record rule.
- Open your already existing application or start a new one.
- Create a new table.
-
Add an entity to your app by clicking the Add any icon from the top of the canvas and selecting Entity.
- Bind the newly-added entity to the table by adding it in the Data Source field of the table.
-
Add the following expression in the Data Context field of the main page:
=Lookup(Customer, [Name, "=", "Demo"])
. - Add a new button control.
-
Configure a Create/Update Entity Record rule for the button. Add the Customer-Main Page data context in the Which entity record should be created/updated? field. The rule should be populated with the configured data context.
- Open your already existing application or start a new one.
- Create a new table.
-
Add an entity to your app by clicking the Add any icon from the top of the canvas and selecting Entity.
- Bind the newly-added entity to the table by adding it in the Data Source field of the table.
-
Add the following expression in the Data Context field of the main page:
=Lookup(Customer, [Name, "=", "Demo"])
. - Add a new button control.
-
Configure a Delete Entity Record rule for the button. Add the Customer-Main Page data context in the Which entity record should be deleted? field. The rule should delete the configured data context.
- Open your already existing application or start a new one.
- Create a new table.
-
Add an entity to your app by clicking the Add any icon from the top of the canvas and selecting Entity.
- Bind the newly-added entity to the table by adding it in the Data Source field of the table.
-
Add the following expression in the Data Context field of the main page:
=New(Customer)
. -
Add two textbox controls:
- Add
Data Context.Name
in the the Value Binding property of the first textbox control. - Add
Data Context.City
in the the Value Binding property of the second textbox control.
- Add
- Add a new button control.
- Configure a Create/Update Entity Record rule for the button. Add the Customer data context in the Which entity record should be created/updated? field. By doing this, data is automatically bound to the fields.
-
Remove the unused data from the fields. Make sure that you keep the data configured at step 6 in the Values to set fields.
To directly refer to a selected entity field value from a table in a different page, you need to use at least one variable.
Instead of creating variables for each field, you can use one for the Entity Id. On the second page, you can do the following:
- Add a container control.
- Configure the Data Context property of the container as follows:
Lookup (Entity, [id, "=", myVariableID])
. - Add the needed controls inside the container and bind them to the available fields for the entity available in Data Context.
You can use the Lookup function in this case because you can treat it as an entity object. This means that you can update that entity using the Create/Update Entity Record rule on the container data context.