Hi guys,
I've created a custom action to capture form submission data and send it to a Sharepoint List.
I'm having trouble now mapping the appropiate data to a column as the data returned in the $entry array only has the field IDs as the meta keys. Is there anyway I can show field names here instead of the IDs e.g 9 become Firstname.
Thanks
James
Example return by $entry:
stdClass Object ( [id] => 9 [item_key] => 860hw [name] => etnaetrn [description] => Array ( [browser] => [referrer] => ) [ip] => [form_id] => 2 [post_id] => 0 [user_id] => 1 [parent_item_id] => 0 [is_draft] => 0 [updated_by] => 1 [created_at] => 2024-05-30 07:09:31 [updated_at] => 2024-05-30 07:09:31 [form_name] => Test form [form_key] => test-form [metas] => Array ( [9] => foo [10] => bar ) )
You can take both a form id and a field id and get all the information you need by using FrmField::getOne and FrmForm::getOne and passing the ID. The return value will contain all the information you need. You can see various examples here. Alternatively, you can write your own SQL commands to get the information from the frm_fields table. btw, I think you're confusing form and field as the information pasted above is for a form, not a form entry.
Cheers Rob, that makes sense. Will give it a go.
Please login or Register to submit your answer