Refresh GET API results in frontend after submitting changes

Options
Hello,

I'm building a web / mobile app and whenever a user edits, adds, or deletes an item, I want them to see the results reflected on the page they are viewing. For example, if the user makes changes to their profile, I want the GET APIs to refresh so that once the user hits submit, that change is now flowing through the GET API.

Currently, I don't know how to do that so even after a change has been successfully made, I have to refresh the web / app page in order to see the results reflected. Otherwise, it remains as it was prior to the change.

I use Bubble and I'm considering another app as well for native mobile app development. I've figured out how to refresh a Repeating Group in Bubble to reflect the changes as soon as they are done but I can't do that for anything else that isn't a Repeating Group.

Is there a way to do this on the backend in Xano so that regardless of which frontend I use, the data sent to the frontend automatically refreshes after a change is made without necessarily refreshing the page? If there's no workaround to this, then any suggestions on how to solve (including from the frontend) this will be appreciated.

Comments

  • Chris Coleman
    Chris Coleman Administrator

    ADMIN

    Options
    Hey, Eben. I feel like this would definitely have to be solved on your frontend. Xano is happy to send the data as often as needed, but it has to be called first, so you'd have to build some functionality in your frontend to refresh that data dynamically. There are definitely some Bubble wizards here who will hopefully be able to help with this, but I'd also recommend posting in Bubble's forum as well to maximize potential solutions.
  • Eben
    Eben Member
    Options
    got it. Thank you, Chris.
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
     what are you using for your front-end?
  • Eben
    Eben Member
    Options
     Bubble for the web app and FlutterFlow for the mobile app
  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Bubble does not support push notifications that would be necessary to do this on an event basis. However, there is a third party working on it: https://javascript.plainenglish.io/sending-push-notifications-with-bubble-io-b85e8919adf9

    In the alternative you could set your app to periodically get new info from the server so it gets refreshed without user action.

    it’s much more straightforward in flutter flow, which support in app notifications. https://docs.flutterflow.io/troubleshooting/push-notifications.

    You then tie the refresh of your data to receiving the notification that there is new data available!

    There may be other solutions out there I haven’t heard about. Hope the preceding gets you started!
  • Eben
    Eben Member
    Options
     thank you. I'll review the links above now.
  • Ryan Anderson
    Options
    I’m using Xano and Bubble too and had to figure this out too.
    1.  You need to refresh the data source by updating the list (Repeating Group). You can do this with the action after your POST/DELETE request - use the action called something like “Set data in a list”. You can then set the source to be your GET request
    2. Bubble seems to cache data data from API calls and will only refresh the data when the API call data changes. To get around this, add a  parameter (any kind) to your API call in Bubble, called something like “refresh_stamp” and then in your action or condition, set that field to Current Date Formatted to ISO simple - that way the API call data is slightly modified each time it runs and will get fresh data from Xano


    Hopefully that make sense but if not let me know and I’ll record a video.
  • Eben
    Eben Member
    Options
     omg. Thank you so much!! This approach worked. It's such a relief to see things working again after banging my head against the wall for so long. Thank you!!!
  • Ryan Anderson
    Options
     You're welcome!
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
     I'm trying to the same thing using time parameter to refresh icon after click, but it is not working so far.
    [image.png][image.png]
    How did you made you case working?
  • Ryan Anderson
    Options
     Where’s your GET request and how are you setting your data source? That’s where the time stamp needs to be, not on the POST request.
  • Eben
    Eben Member
    Options
     do you have the answer you need? I haven't responded because Ryan already did but wanted to check if you're all good.
  • Pawel Magdanski
    Pawel Magdanski Member ✭✭✭
    Options
    Yeah, it works now. Thanks for asking.