<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: POST $data array labels/names</title>
		<link>https://legacy.forums.gravityhelp.com/topic/post-data-array-labelsnames</link>
		<description>Gravity Support Forums Topic: POST $data array labels/names</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 23:42:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/post-data-array-labelsnames" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "POST $data array labels/names"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-data-array-labelsnames#post-103766</link>
			<pubDate>Tue, 18 Dec 2012 00:13:59 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">103766@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks for that code Chris.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Bates on "POST $data array labels/names"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-data-array-labelsnames#post-103663</link>
			<pubDate>Mon, 17 Dec 2012 19:20:14 +0000</pubDate>
			<dc:creator>Chris Bates</dc:creator>
			<guid isPermaLink="false">103663@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've managed a workaround... I used gform_field_standard_settings to create another &#34;label&#34; type field.&#60;/p&#62;
&#60;p&#62;Then in the gform_after_submission hook I loop through all the form fields, creating a new array around the custom label.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// loop through the form fields
	    foreach($form[&#38;#39;fields&#38;#39;] as $field) {
	        if ($field[&#38;quot;api&#38;quot;]) {
	        	if (is_array($field[&#38;quot;inputs&#38;quot;])) {
		        	foreach ($field[&#38;quot;inputs&#38;quot;] as $input) {
		        		$newid = explode(&#38;quot;.&#38;quot;,$input[&#38;#39;id&#38;#39;]);
			        	$data[$field[&#38;quot;api&#38;quot;].$newid[1]] = array($input[&#38;quot;label&#38;quot;], $entry[&#38;quot;&#38;quot;.$input[&#38;#39;id&#38;#39;]]);
		        	}
	        	} else {
			        $data[$field[&#38;quot;api&#38;quot;]] = array($field[&#38;quot;label&#38;quot;], $entry[$field[&#38;#39;id&#38;#39;]]);
			    }

			    echo &#38;quot;&#38;lt;strong&#38;gt;&#38;quot;.$field[&#38;quot;api&#38;quot;]. &#38;quot;:&#38;lt;/strong&#38;gt; &#38;quot;.$field[&#38;quot;label&#38;quot;].&#38;quot;&#38;lt;br /&#38;gt;&#38;quot;;
	        }
	    }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "POST $data array labels/names"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-data-array-labelsnames#post-103507</link>
			<pubDate>Mon, 17 Dec 2012 11:26:57 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">103507@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Unfortunately not, as each field needs a unique name, and so we force this by taking control over naming each item in each form so it is unique.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Bates on "POST $data array labels/names"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/post-data-array-labelsnames#post-103366</link>
			<pubDate>Mon, 17 Dec 2012 04:18:20 +0000</pubDate>
			<dc:creator>Chris Bates</dc:creator>
			<guid isPermaLink="false">103366@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm working on an integration, using gform_after_submission and the $data array.&#60;/p&#62;
&#60;p&#62;I was wondering if there's an easy way to make the array names more meaningful / consistent across multiple forms?&#60;/p&#62;
&#60;p&#62;For e.g. two forms with a Field calls &#34;My Field&#34;, in one might have the ID 1 and in the other might be ID 2. As it stands, I need to map each form manually because I have to manually say that &#34;My Field&#34; is $data[1] in Form A, and $data[2] in Form B.&#60;/p&#62;
&#60;p&#62;I'd like for both to just be accessible as $data[&#34;MyField&#34;]&#60;/p&#62;
&#60;p&#62;The reason I ask, is, I want this integration to work standard across multiple forms. As it stands, I would need to map all of the field IDs to a name then run it through the processor. I'd like to have GF do that for me though, so I don't need to map each form manually (allowing me to create and launch forms with ease).&#60;/p&#62;
&#60;p&#62;I suspect the answer is no, not without some major modifications.  But you never know!&#60;/p&#62;
&#60;p&#62;Even if it was some easy way to map the Field ID to whatever the Field Label is in the form design. Or even the Admin Label.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
