# Save confirmation name in entry when triggered as conditional logic \[RESOLVED\]

**URL:** <https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563>\
**Category:** Get Help\
**Tags:** custom, gfapi, add\_note, conditional-logic\
**Created:** [February 27, 2023, 9:54am UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563 "2023-02-27T09:54:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user632940628742e589](https://avatars.discourse-cdn.com/v4/letter/u/6de8d8/32.png) [@user632940628742e589](https://community.gravityforms.com/u/user632940628742e589)\
**Post date:** [February 27, 2023, 9:54am UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/1 "2023-02-27T09:54:25Z")

</div>

Hi,

I have a form with 10 fields.  
I have different confirmations with conditional logic based on the value of the fields.  
Everything’s working well.

I’d like to store in the database what confirmation has been triggered for every entry.

For example :  
Entry 1 has trigerred confirmation 5 (C5).  
Entry 2 has trigerred confirmation 9 (C9).

Is there a way to do that ?

Regards

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [February 28, 2023, 6:56pm UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/2 "2023-02-28T18:56:11Z")

</div>

Hello Yoann. It would require a bit of code but it should be possible. You would need to run some code when a specific confirmation is processed, and then you could add a note to the entry using the GFAPI that adds the confirmation name there.

Here is the GFAPI documentation for adding a note:

> **[Managing Notes with the GFAPI](https://docs.gravityforms.com/managing-notes-with-the-gfapi/#h-add_note)**
>
> The GFAPI methods for managing notes were added in Gravity Forms 2.4.18.

Do you know what type of confirmations these will be? Are they always text or redirect confirmations, or might they vary? I’m trying to find a filter you can use to get the information you need, and the type of confirmation matters. If you can provide that, I will keep looking. Thank you.

---

<div class="post-metadata">

**Author:** ![user632940628742e589](https://avatars.discourse-cdn.com/v4/letter/u/6de8d8/32.png) [@user632940628742e589](https://community.gravityforms.com/u/user632940628742e589)\
**Post date:** [March 1, 2023, 9:27am UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/3 "2023-03-01T09:27:32Z")

</div>

Hi Chris,

Thanks for your support.

The confirmations are always “type”:“page”.  
Having the page label for the entry would be perfect.  
Can the page label be stored in the entry in a field “confirmation” ?

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [March 1, 2023, 4:28pm UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/4 "2023-03-01T16:28:27Z")

</div>

Hi Yoann. You can store the URL that was used for the confirmation redirect in a field in the entry using this code:

```auto
// apply to form 63 only
add_filter( 'gform_confirmation_63', function ( $confirmation, $form, $entry ) {
    GFCommon::log_debug( __METHOD__. '(): My Confirmation => ' . print_r( $confirmation, true ) );
	// ID of the field where you want to store the confirmation that was used
	$field_id = 6;
	$result = GFAPI::update_entry_field( rgar( $entry, 'id' ), $field_id, $confirmation['redirect'] );
	GFCommon::log_debug( __METHOD__. '(): Result of updating entry with confirmation => ' . print_r( $result, true ) );
    return $confirmation;
}, 11, 3 );

```

The form ID will need to be updated from 63 to whatever the form ID is on your site. And then `$field_id` will need to be changed from 6 to whatever the ID of the field where you want to store the confirmation URL in your entry is.

If you have any other questions, please let us know.

---

<div class="post-metadata">

**Author:** ![user632940628742e589](https://avatars.discourse-cdn.com/v4/letter/u/6de8d8/32.png) [@user632940628742e589](https://community.gravityforms.com/u/user632940628742e589)\
**Post date:** [March 2, 2023, 1:40am UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/5 "2023-03-02T01:40:24Z")

</div>

Hi Chris,

Thank you, this is perfect.

Best regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [April 1, 2023, 1:41am UTC](https://community.gravityforms.com/t/save-confirmation-name-in-entry-when-triggered-as-conditional-logic-resolved/14563/6 "2023-04-01T01:41:03Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
