Been working for over an hour on this and running out of steam.
I have a “Prompt” content type in my database. Two fields of concern:
- Prompt Content: the actual content
- Prompt Version: the version, which increments by 1 each time I add a new prompt
(There are currently two entries for testing purposes.)
I have watched videos, googled and asked Perplexity how to get the prompt to display on the front end. Here was Perplexity’s answer:
To display the most recent “Prompt” based on the “Version” field in your Bubble.io application, follow these step-by-step instructions:
1. Verify Your Database Setup
- Data Type: Ensure you have a data type named
Prompt.
- Fields: Confirm that
Prompt has the fields Prompt Content (for the text) and Version (for tracking versions).
2. Design Your Page
- Add a Text Element:
- Drag a Text element onto your page where you want to display the most recent prompt.
3. Configure the Data Source for the Text Element
-
Set Up a Dynamic Data Source:
- Click on the Text element to open its properties panel.
- In the “Text” field, click “Insert dynamic data.”
-
Perform a Search for Prompts:
- Select “Do a search for…” and choose the
Prompt data type.
-
Add Sorting and Constraints:
- In the search configuration:
- Sort by: Choose the
Version field.
- Sort Order: Set it to “Descending” to ensure that prompts are ordered from highest version to lowest.
-
Select the First Item:
- After sorting, use
:first item to select the most recent prompt.
-
Display the Prompt Content:
- After selecting
:first item, append .Prompt Content to display the content of the most recent prompt.
The complete dynamic expression should look like this:
Search for Prompts:sorted by Version descending:first item's Prompt Content
4. Test Your Setup
- Preview Your Application:
- Click on “Preview” in Bubble.io to test your setup.
- Ensure that the Text element displays the content of the most recent prompt based on the highest version number.
Example Configuration
- Dynamic Expression Example:
This setup ensures that your application dynamically retrieves and displays the latest prompt content from your database, using Bubble.io’s sorting and filtering capabilities to show only the most recent entry based on version numbers. If you encounter any issues, double-check each step to ensure everything is configured correctly, especially field names and sorting options.
That doesn’t seem to align to how those expressions are actually being used now, so I grabbed a couple screenshots of how I’m using them:
That setup resulted in a blank page.
What am I missing here?! It’s making me crazy. Big thank you in advance for any help!
What does the debugger show?
Here’s a screenshot. Is this what you’re looking for? Still learning the platform over here.