API Workflow for auction. How would you pros set the winner?

Hi all.

I have a repeating group that has a list of things that will be auctioned, lets call them auction listings. Each of those listings has an expiry date for the listing to be active up until that date/time. Other users will be able to bid on those things and when the last one to bid on a thing before the expiry date/time goes out should be the winner.

I have also set the auction listings up with: “Expiry date”, auction “leader” and a “winner” field for the listings. Every bid from a user makes them that listings “leader” and if [expiry date < current date/time] then [winner = this listings “leader”]

I can make this work with the push of a button with an API workflow, but I cant seem to get it to work automatically by setting the timing for the API workflow to fire when a listing is [expiry date < current date/time].

Also I am confused about API workflow on a list or not in this case? It has to check a list of listings to determine those listings who qualify for the [expiry date < current date/time] part, but I am not sure.

If you have any straight forward tips on how to set this up correctly that would make this work I would be so thankful!

Kris

Hi @kris, here’s how I’d do this:

  1. Create an API Endpoint with a parameter for Listing
  2. This endpoint should have an action to “make a change to [listing]”, where the change is winner = [listing]'s leader
  3. In the workflow that first creates the listing (assuming the expiry date is a part of listing creation), add an action to “Schedule API Workflow” (not on a list). Parameter’s value = Result of Create Listing step. Schedule date = Result of Create Listing’s step’s Expiry date.

That’s it.

What the above is doing is scheduling the winner field to be updated to happen at the expiration date/time. The parameter is to pass the new listing record over to the API endpoint so it knows which listing to work with. When that date/time arrives, the Make a Change action will run and whoever happens to be the Leader at that moment will be saved as Winner. Let me know if you have any questions!


Gaby at Coaching No Code Apps (formerly Coaching Bubble)

Courses & Products, Tutorials, Private Coaching, and High-level Development

Start Learning Today :mortar_board:

2 Likes

Thanks Gaby! I will try that!

That solution seems so much smarter than what I was messing around with. Guess efficient logical thinking comes with time and experience…Now I will have to put some bids in and wait for a listing to trigger expiry date to see if it picks the winners correctly :slight_smile:

Kris

Fantastic! Sounds great. Not sure how you’re saving expiry date/time, but if you have full control, just save it to several minutes in the future so that you have time to bid as a few users and get the results quickly :slight_smile:

1 Like

Working as a charm @romanmg :smiley: The app just decided that the leader of the auction listing won after time ran out.

Thanks again Gaby! <3

1 Like

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