Make changes to a list in repeating group

Hello everyone, I have this list of items (which are part of a repeating group). I need to check, ie when the current date is higher than the requested date, then a field in my database must be changed for that cell, setting the “filed” field to yes only for that cell. I can’t figure out how to set this on my workflow, I currently set it on page load.

But I am issued an error

I think you need to do a search for the order’s date that you’re comparing the current date to. Something like:
Only when “Current Date > do a search for orders: First Item Orario_date” and then include in your search constraint the specific order you’re looking for.

but in this way if there are more “expired” orders he only gets the first one, right?

My understanding is that he is just looking for a single date to trigger a change to the list. The RG contains the orders that need to be changed.

actually no. I expressed myself wrong, each order has a different “expiration” date. I am interested in that all the orders contained in the repeating group that have an expired date, are set with the filed on yes in the db

ah, I don’t believe you can access the RG’s orders directly to do that. You need to do a separate search in your list to change that is essentially a copy of your data source in your RG.

edit: your list to change will include the constraint of expired date.

As I was thinking a little more about what you’re looking to do, I think there is an overall better way to do this.

Firstly, do I understand correctly that the problem you’re looking to solve is the updating of all orders that have expired? In other words, this doesn’t really have anything to do with the RG. All orders that have expired need to have their “filed” = yes?

Let me know if this is the case as I have a few suggestions on how you can make this a lot cleaner. One specific issue with your current mode is the change list action will be slow to run on page load, and doesn’t need to be done in this way.

yes, this is the ultimate goal. In practice I have to ensure that when “orario_date” > “current_date_time” automatically the orders of that restaurant must change their value in the table in filed = yes

I think you should do this via a backend workflow that runs nightly:

  1. Create a Backend (API) workflow called something like “update_filed”.
  2. Add an action to make changes to a list of things. In your search for the thing to change, search for orders where“orario_date” > “current_date_time” and filed = no. Add field to change filed = yes.
  3. Add a second action to that schedules the API workflow you created in step 1 “update_filed”.
    make the scheduled date tomorrow - Like this.
    Screen Shot 2020-09-23 at 6.59.35 AM

Now all you need to do is kick off this recursive BEWF once and it will run nightly in the background. Do this by creating a button on any form that schedules the API workflow update_filed. Kick it off at night and then it will run every 24 hours from the time you kicked it off.

*Note: this approach will only work so long as your list of orders to change is <=100. If your order list count is more than 100 then the solution gets a bit more complicated. Let me know.

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