Can someone please double check my backend workflow schedule a workflow delete data

Dear users,
I’m a complete beginner and I need some advice en help.

I bought a real estate marketplace thimo. I had to install a backend workflow becouse I want to delete the listing of the user after 60 days
Did I do it right? Won’t I lose all my data?
I’m insecure.



KInd regards
Stijn from Belgium

What I would do is remove the “schedule workflow” action in your backend workflow and put it where the listing is created, i.e. a button

2 Likes

Think of it this way…

You have a backend workflow called ‘deletedataafter60days’.

When that workflow is triggered, it will run through the steps within it:

In your case, Step 1 of the workflow ‘deletedataafter60days’ is to trigger the workflow ‘deletedataafter60days’ 60 days after it is triggered (in other words it will trigger itself on an infinite loop).

So when the workflow is triggered it will schedule itself to run again in 60 days time, and then another 60 days time, and another 60 days, and so on forever more.

This is NOT what you want.

The ‘Schedule API Workflow deletedataafter60days’ action needs to happen in whichever workflow is used to create the property in the first place. So when a property is created, it’s scheduled for deletion 60 days later.

The only step this workflow needs is to delete the property you want to delete.

So get rid of Step 1 - you only need 1 step - ‘Delete Property’

Also it doesn’t need to be exposed as a public endpoint (unless it’s being triggered externally), and you don’t need to have a key for ‘current date’ (Bubble knows the current date).

The workflow should simply have a key for Property (which is type Property) - this will be the property that you want to delete:

Step one will simply delete the ‘Property’ passed into the workflow in the ‘Property’ key from whatever triggers it:

That’s all there is to it.

Then you schedule that backend workflow from wherever you created the property in the first place, scheduled for 60days time.

2 Likes

Hi
thank you so much. I understand I made it needlesly complicated. But the last sentence I don’t understand. “Then you schedule that backend workflow from wherever you created the property in the first place, scheduled for 60days time.”
Where do I place " current date+ 60 days"?
Sorry if I ask stupid questions, I’m slow with this kind of things.
do I have to add this last step? Is this ok?
Thank you so much in advance.
Kind regards
grtz

Hi @anon70120467,

You need to trigger this backend workflow when you create the ‘Property’ that you want to delete (and NOT from within the backend workflow itself, as you’ve shown in the image above - that will not work, and will create an unwanted loop).

Your backend workflow should only have 1 step - the ‘Delete property’ step.

Without knowing how your app works it’s impossible to say how/where you need to trigger this workflow from but, presumably, you have a workflow somewhere that is used to create properties in your database.

Maybe it’s you that creates the property, or maybe it’s your users (it depends how your app works), but somewhere you must have a workflow with an action ‘create a new thing’ that creates a Property.

Wherever that workflow is you need to include a step AFTER the property has been created to schedule the backend workflow ‘deletedata’.

So the whole process might look something like this:

  1. A user fills out a form to submit a property

  2. When they click a ‘Submit’ button a workflow is run that might look like this:

Step 1 - Create a New Thing (a Property with the data from the form they’ve filled out).

Some other steps (depending on what you want to do)

Final Step - Schedule API workflow ‘deletedata’ for current date +60 Days, where the ‘Property’ is the result of Step 1 (that will schedule this property to be deleted after 60 days).

Hi Adam, This is the former step where the user filled out the form and uploaded the property/listing.

Grtz

Hi @anon70120467,

Yes, that looks right to me, so it should work fine.

Just one more thing to be aware of…

Once the workflow is scheduled to delete the listing in 60 days time, the only way you can stop that from happening is by cancelling the scheduled workflow.

So if a user makes changes to a listing or updates it, you may, or may not, want to cancel the scheduled workflow and resheculde a new one.

It entirely depends how you want your app to work - if you want the listing to ALWAYS be deleted 60 days after it was created, even if it gets modified and updated after 59 days, then it’s fine as it is.

But if you want it do delete 60 days after any modification, then you’ll have to build in some logic to cancel the previous scheduled workflow.

But again, it depends how you want to app to work with regard to users being able to update and modify listings.

As you’ve got it at the moment it should work perfectly to delete a listing after 60 days no matter what, so if that’s how you want it to work then you’re all good to go :slight_smile:

Hi Adam,
I have some questions about reaching the public. I want to add an icon/ favicon to my bubble app. I want the public to be able to install my app on their phone. I want to adjust an favicon to my app. How do I do that?
Can I also make a button on my website with a link with the url of my app? Are there instruction video’s?
Good evening from Belgium
Stijn

Hi is it here?


grtz

To set a favicon, you have to go Settings > General, then scroll down. You have to be on a paid plan as well.

Hi thanks Johnny. I will try. Thanks for the advice. grtz

Hi @anon70120467,

I’m afraid I can’t help much in regard to making mobile apps (it’s not something I have much experience with) but depending on whether you want a PWA or a native mobile app you should be able to find plenty of info on this forum.

As for a Favicon, as @johnny said, you can find that on the settings for your app.

And yes, you can link to the URL of your app from anywhere you like, so if you want to include a link from your existing website just add a button (or text) with a link to the home page (or any other page) of your bubble app.

Hi @anon70120467,

By default your app will be hosted on the bubbleapps.io domain, but if you want to use another domain you just need to buy one from a domain registrar and change the DNS settings. Or you can use a subdomain of your current website (e.g. appname.currentwebsite.com).

If you’re on a paid Bubble plan then there shouldn’t be any ‘Built On Bubble’ objects on your site (if you’re on the Free plan then it will always be there), so if you’re seeing ‘bubbleapp without code’ or something like that then presumably that’s part of whatever template you’re using - so you should be able to just delete it in the editor.

Also, as long as you’re on a paid plan, you can remove the Bubble mention from the console from within Settings>General.

Thank you very much Adam.
grtz

That looks right - as long as the values of each of those records are set to the values Bubble gave you then that should work.

It might take a day or 2 before it switches over - so keep checking back on it.

Actually, no…

It looks like you’ve got 2 A records and 2 AAAA.

You should have 4 A records, as shown in Bubble, 2 for your bare domain, and 2 for your www. domain - using the values provided by Bubble

You need to add the 4 records Bubble has given you

At the top of your one.com page, where it says ‘create record’, enter the name into hostname, and the value into Enter URL.

Do that for each of the 4 records Bubble has shown you.

Where the name is blank you can try entering @ - that should work - but it depends on how your domain registrar works - it might pay to consult their documentation.

And you probably want to remove the web forwarding setting to the test version of your app - that wont help.

If you’re still having trouble then contact their support for help.

You just need the 4 A records Bubble gives you.

I think I managed to do it.


Do I still need to reset DNS records or is it ok like this? What do you think?

grtz
Have a great weekend. ( here it rains again.)

That’s right, and I’ve just checked it and it’s working fine…

immozoeken.be is now pointing to your Bubble app.

I’m not really sure what you’re trying to achieve with your web forwarding, (redirecting a subdomain to the test version of your app, on bubble’s domain), but if that makes sense to you then it should be fine.