Hi. I’m using GFAPI to update entry status from “Processing” to “Paid” (I’m using paypal payments addon), problem is, if I update it manually via gravity forms (wp admin panel), then it registers as paid and workflow continues to next step, if I update with code like this:
then on entry it says that it has been paid, but workflow won’t advance to next step. I am using form submission between two forms. When the entry with payment is paid, it should go back to the first form and advance it forward, it doesn’t. Any idea why?
If “Update an entry” works like I think it does (listening to one value and updating the workflow when that value is updated via API) then that’ll do. Thanks!
When the entry with payment is paid, it should go back to the first form and advance it forward, it doesn’t.
That is because the GFAPI::update_entry does not trigger the gform_after_submission action which Gravity Flow has some events hooked to determine whether step(s) have been completed or how to address workflow processing. If your modifications to $entry are enough to complete a step after that update_entry you could try adding this line, but as mentioned earlier there are likely other entry meta values you’d have to update for this. gf_do_action( array( 'gform_after_submission', $form['id'] ), entry, $form );
It is closer to doing what you already have in your snippet just built without code. Provided you have the Entry ID for an entry in Form A stored in a field of an entry in Form B, when the entry in Form B gets to an ‘Update an Entry’ step in its’ workflow, you can use field mapping to update multiple values in the entry of Form A. So an equivalent to your snippet above would be settings like this:
The same step type can also be used to mark an approval or user input step as complete. Through support, we could help you in more detail if the above isn’t sufficient.