Test values in a page
-
- UpdatedAug 1, 2024
- 2 minutes to read
- Xanadu
- Building applications
Add test values to your URL as a way to bring test data into a page.
Use test values to give values for required and optional URL parameters as a way to test your page with actual data.
Test values are important because you can use them to simulate how your page behaves when the page gets its required or optional parameters from the URL. A UI Builder URL is not the same as the URL when you preview your page. So, UI Builder needs a way to simulate what happens to the page during different states of the preview URL.
For example, say that you’re building a record page that displays a form for a single record. For the record page to load, the page must have a <table> and <sysId> in the URL so that it can get and display the proper record. In UI Builder, you must supply test values for the table and sys_id so that you can see how the page looks when you preview the page.
To get test values to show data, add a data resource, then configure the data resource to bind a record to the test value in the URL. For example, you could add incident as a test value.
Then add a data resource named Look Up Record. In the Table field, dynamically bind the incident test value to a context.props.table
table, as shown in the following
image.