Hello Vladt,
I have attached an fdf that demonstrates these two questions. In the menu called ‘DataView’, is a data view that updates depending on which user has been selected, in the menu called ‘DashBoard’ is a dashboard consisting of two data views in which are both updates when a user is selected in the search bar above them.
QUESION 1 → Single Data View
Within the query you are using for the Data View, you will need to add a parameter.
In this image, the added parameter is ‘userkey’. The value placed in this parameter is the value which fills in the placeholder value (?) in your query. The name of this parameter ({{five.variable.NAME}}) must match with the corresponding database field.
Within your Data View, this query is then added to the Data Source field.
In Screen Fields, you will then need to add a field in which is used to acquire the user key from a dropdown menu.
In my example, I have used a look up query so that the user’s names are displayed within the dropdown menu. When a user is selected from this dropdown, the user key for that user will be passed into the initial query, the Data View will then display the data related to this user key.
QUESTION 2 → Dashboard
After creating a dashboard, you will need to adjust the rows to be 2 and the columns to be 2.
This will allow for a search feature to be added at the top, and then two Data Views to be added at the bottom.
Next, you will need to create a process. These can be created under the ‘Tasks’ tab in the five navbar.
Within this process, you will need to attach a query to acquire a user key (or database key value you wish to grab). In my example, I have used the same lookup query from before to look up the users and display their names in the dropdown menu.
Within your two queries used within the two Data Views, you will also need to add the corresponding parameters (like we did in the single Data View).
Within the Dashboard, add the process in the top row (A1), and the two Data Views in the bottom row (B1), (B2).
Finally, you will need to create a function in order to refresh these Data Views when selecting an item from the dropdown menu.
To do so, go to Logic > Functions > Add Function (+ button)
This is the function used in my example. For info on the refreshTable() function in Five, head to refreshTable() | Five | Low-Code For Real Developers . For info on the setVariable() function, head to setVariable() | Five | Low-Code For Real Developers .
Save this function and head back to the processes tab. You will now need to attach this function to the process you previously created.
- Click the process and click screen fields
- Click into the screen field you created
- Click events
- Attach the function to the ‘On List Select’ event
Now, the two Data Views will update when selecting an item from the dropdown menu (the process).
I have attached the fdf containing the example I have shown below so you can see it and follow through with the steps.
DataViewQuery-20240805-063948311253514.fdf (3.4 MB)
Please let me know if you have any more questions,
Thanks,
Riley.