Workaround Privacy Rule Not Updating in Real-Time Without Page Refresh

Hi everyone,

I’m working on a single-page app for booking parking spots. The parking spot photo is hidden by privacy rules and should only be visible to users who have booked that spot.

Here’s how I’ve set it up:

  • When a user books a parking spot, I add the spot to their “spots access ok” list (a list field in the User data type).
  • The privacy rule on the Parking Spot data type is:
    “When Current User’s ‘spots access ok’ list contains This Parking Spot” → The private photo is visible.

The problem I’m facing is that the privacy rule doesn’t update dynamically. The user can only see the private photo if they refresh the page, which isn’t ideal for UX.

I’ve tried several approaches, including:

  • Running a “Do a Search for” query after the user books.
  • Loading the data conditionally (e.g., only when the Current User’s ‘spots access ok’ list contains the parking spot).

Unfortunately, none of these methods have worked.

Has anyone encountered this issue before or found a solution?

Thanks in advance!

Can you just refresh the page using the refresh the page action?

If you absolutely cannot have that, you could return the URL of the parking spot photo from the backend using an API Connector call to your own backend, but for this use case is probably overkill

I have had the same issue. It’s really frustrating. Sometimes this is the best way to set up the database and it is annoying that it doesn’t update automatically. Really wish they would fix it. :blush:

You might want to try to add another field somewhere to see if you can change the way you do privacy rules somehow. Maybe add another dataType or something. :man_shrugging: Does that make sense?

Also, have you tried refreshing just the repeating group?

1 Like

Hi George !

Thank you for your insight.

Yeah I really want to avoid doing a page refresh because as my app is a SPA, it takes 3 to 5 seconds to load and this isn’t ideal for the user experience.

Doing an API call to my own backend to return the desired data is a great workaround, thank you for the idea ! It’s not ideal but it works so I implemented this for the moment :slight_smile:

the issue is possibly more related to how you are displaying your data.

If your source for the visual elements is a do a search for, Im pretty sure (but not 100% sure) as data gets changed the visual elements will redisplay properly.

If you are explicitly setting the source using a workflow using set state or display data, then it is possible that the data will not autoupdate.

I prefer to have all my elements do a search for with their criteria and when changes are made to the underlying data, they autoupdate.

This topic was automatically closed after 70 days. New replies are no longer allowed.