PHP/API Update entry status

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:

$entry = GFAPI::get_entry("193");
$entry["payment_status"] = "Paid";
$entry["is_fulfilled"] = "1";
$result = GFAPI::update_entry($entry);
return $result;

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?

Hi Rytis. I recommend contacting Gravity Flow for support with this issue. Thank you.

1 Like

@user60a56853c0bfb400 - There are other entry meta values which control current step / workflow status / etc. Along with Chris solid suggestion that support is there to directly assist with your case, you may also want to look at the The Workflow Orchestration API - Gravity Flow docs - it may be that you need to also restart current step of the “updated” form. Or look at using the Form Connector - Update An Entry - Gravity Flow step.

1 Like

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! :slight_smile:

1 Like

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 );

If so, use of the send_to_step from Gravity Flow orchestration API could be your best snippet to add to what you’ve already got.

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.


1 Like