Skip to content

Commit cbe0d9b

Browse files
committed
gca-create-relation.php: Added experimental header flag, added hook doc link and added note about possible hook name variants.
1 parent 874cdd3 commit cbe0d9b

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

gc-airtable/gca-create-relation.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,32 @@
22
/**
33
* Gravity Connect // Airtable // Create Phone Number Relation
44
*
5+
* Experimental Snippet 🧪
6+
*
57
* This snippet demonstrates how to create a relation between two tables in Airtable
68
* when a GC Airtable feed is being processed. It uses an example assuming the following:
79
*
8-
* 1. There are a "People" table and "Phone Numbers" table in Airtable.
9-
* 2. The "Phone Numbers" table has, at minimum, a phone number field and a link field.
10-
* 3. There is a GCA feed that creates a record in the "People" table.
11-
* 4. The snippet adds a phone number to the "Phone Numbers" table and creates a relation
10+
* 1. There are a "People" table and "Phone Numbers" table in Airtable.
11+
* 2. The "Phone Numbers" table has, at minimum, a phone number field and a link field.
12+
* 3. There is a GCA feed that creates a record in the "People" table.
13+
* 4. The snippet adds a phone number to the "Phone Numbers" table and creates a relation
1214
* between the newly created "People" record and the "Phone Numbers" record.
1315
*
1416
* Installation:
1517
* 1. Install per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
1618
*
17-
* https://gravitywiz.com/documentation/gravity-connect-airtable
19+
* References:
20+
* * https://gravitywiz.com/documentation/gravity-connect-airtable
21+
* * https://gravitywiz.com/documentation/gca_entry_added_to_airtable/
1822
*/
1923

24+
/**
25+
* You can also apply this to individual forms for feeds for more granular control. For example:
26+
*
27+
* add_action( 'gca_entry_added_to_airtable_FORMID', function( $entry, $create_record_resp, $gca_connection_instance ) {} );
28+
* add_action( 'gca_entry_added_to_airtable_FORMID_FEEDID', function( $entry, $create_record_resp, $gca_connection_instance ) {} );
29+
*
30+
*/
2031
add_action( 'gca_entry_added_to_airtable', function( $entry, $create_record_resp, $gca_connection_instance ) {
2132
$gf_phone_number_field_id = '1'; // The ID of the form field which contains the value you want to use to create the relation.
2233
$table_id = 'TODO'; // The ID of the Phone number

0 commit comments

Comments
 (0)