$$ a little help! just takes 1 min :)

Hi everyone,

I’m building a hospital social work

simulation app in Bubble, and I’m currently facing an issue displaying a value returned from an API.

What I’m trying to achieve:
When a social worker writes a social evaluation and clicks a button, I send that text to the OpenAI API to calculate a readmission risk (0–100). Then I store that value in my database and display it in the UI as a percentage.


What I already have working:

  • :white_check_mark: API Connector set up correctly (POST to OpenAI)

  • :white_check_mark: The API returns a number (e.g. “75”)

  • :white_check_mark: The value is saved correctly in the database (field: readmission_risk, type: number)

  • :white_check_mark: Each entry is linked to a Patient

  • :white_check_mark: In App Data, I can clearly see the value being stored


My workflow:

  1. Button is clicked

  2. Create a new SocialAssessment

  3. Call API (get_readmission_risk)

  4. Make changes to thing → save readmission_risk
    (Result of Step X’s message content → converted to number)


The problem:

In the UI, I try to display the value using:

Search for SocialAssessments:first item's readmission_risk

(with constraints: Patient = Current page’s Patient, sorted by Created Date desc)

:backhand_index_pointing_right: But in preview, the text element shows empty (or just “%”)
:backhand_index_pointing_right: Even though the data exists in the database


What I’ve already checked:

  • Constraints are correct

  • Sorting is correct

  • Field type is number

  • Value is definitely saved (confirmed in App Data)


My question:

Why is the value not displaying in the UI after being saved?
Is this a data refresh issue, or am I missing something in how Bubble handles newly created data?


Any help would be really appreciated :folded_hands:

Check your DM please

If your data is not showing in UI but is saved on db, certainly problem with your expressions or your data source. You can inspect the element to see the return data.

HELLO! i have this right now. and i dont know why it doesnt work

try to check the Privacy tab on DB. Looks like you data type is private

1 Like

like here?

Yess your privacy rules

ok. Apparently this is not the reason. what does the debugger show? are there any errors?

Run your application with debug mode and inspect the element (the text). You can see what data is returned.

2 Likes

I don’t see in your screenshots you saving the Patient field on the new SocialAssessment created but when you do the search, you’re using Patient as a search constraint.

HELO! I HAVE THIS I REALLY APPRECIATE IF YOU CAN HELPME

Could you attach the debugger on this element? Maybe 52 issues is a problem?

Thank you for your response, I’m at your disposal. The problem isn’t with the issues. I’m already in the inspect section of the percentage.


Could you click here and you will see the data source or issue on the right

Delete this rule, currently in your rule you are referencing a data field that was deleted.

HELLO! what kind of rule do you say??


This one you posted. Delete the rule “patient"

Thanks for replying, I was already told that here, and I’ve already removed it too, but it’s still not working. Do you need specific screenshots so we can troubleshoot the problem? Thanks!

Click on the data, the blue one before “%”it will show the real values. On the right side