Use in-built App components
Last updated
Last updated
Feedback
⬆️ CannyCopyright © 2024 Rewst
You know that my_first_page
page we created earlier? Let's go back there and into the page builder... remember, arrow in the action column?
In the component library, we have a BUNCH of pre-built components that you can simply drag and drop onto the App Builder canvas and start using. Feel free to experiment with them if you want!
In our Hello World project, we're going to use the Data Table. This component allows us to utilise a workflow to generate the content of the table.
Once the data table has been dragged onto the empty canvas, click on "Add a Data Source"
Choosing "Run Workflow on Load" ensures that whenever the page is loaded, the latest data comes in. "Use Latest Workflow" could be used if you were returning data on a cron and didn't want to load it every time for instance.
Once the workflow has finished, you'll see form_output
in the available list
Now we'll hide some columns that you don't need to display to the user. Next to View and Trigger ID, click the dots and select the Hide X Column.
Now let's make sure the user can actually get to the form, rather than just view a list.
In the Accessor dropdown, select the view
key. By leaving the URL blank later on, the action button will automatically use the value from this key. In the Jinja from the last step, we made sure the value was the link to that form.
Change the Type to action
Add a header, which is the column name for this action button.
Under the Button Function, select the Open a link
option.
If you want to make your data table more user friendly, you can even add a tooltip to let them know what's going to happen
Hit the Green Play button in the top right, this is a "Test" button that runs the page as if you navigated to it normally. All being well, you should see a list of forms returned with an action column. If you click the link, you should go directly to that form!
Publish the page to save it
At the top of the menu bar, you'll see a url that is unique to your app. Clicking this navigates to the page itself, the same one you'll send to your users.
💡 You're done!Wow, you've just created your first workflow backed App in Rewst. There was a LOT here, but this is something you can provide to your techs and they can easily navigate to the forms they have access to. It's not the prettiest (yet), but a functional App is an awesome start. Now, let's see what else we can do eh....