It is very sad that the developers do not have time to answer on user’s questions, especially taking into account the lack of manuals.
I’m not a programmer but I have found the solution by investigating source code. Developers have declared functionality of GF List Fields for relation fields. In order to use this advanced option:
– you have to use GF <Advanced Fields> -> <List Field>;
– you must switch on ‘Enable multiple columns’ and leave at least one of them (it is very strange demand if you use only one relation field);
– if you would like to put into the field name (or slug) of related pod you have to use ‘pods_gf_field_column_row_’ hook and handle it manually;
– you have to remember that according to Pods GF Add-on’s current algorithm if List Field contains data but related pod item is not found new item will be created anyway (even you I don’t need this). So you have to handle such situation.
Hope this information will be useful for some users.
Many apologies that we were not able to respond to your question before you solved it yourself. Blame it on a timing issue: we just released the list field support for related items in this most recent 1.4 release. We are still working on the documentation for this feature since it is brand new and the filters to provide alternate field support is completely brand new and undocumented.
For your fastest support, especially when you’re using something cutting edge is on our Slack Chat at https://pods.io/chat/ Our developer for this feature has a full time job that isn’t this plugin, so we have to rely on yiur patience for responses, especially since it’s a free plugin.
I’ll reach out to the developer and see if he can respond to your concerns directly.
Another note. If you’re not adding new entries into the related record, you should use the standard multiple select or checkbox field for your actors and select dynamically populate from the matched field in the feed. The list field support is very new to our plugin, so any suggestions for enhancement or bugs should be reported to our GitHub https://github.com/pods-framework/pods-gravity-forms/issues/new
Sorry, when I built this functionality it was only for multiple columns. I never tested it against single column list fields. That’s my bad, I just didn’t have it in my testing plan.
Thank you for your response. Concerning support of free plugin I have a clear understanding. From this point I have no claims but just a little bit being sad.
You have created very useful tool and of course users who deep dived into Pods are expected from it more and more options. 🙂
I’m sure that the best way to learn programming is to investigate someone’s well done code. That’s why I’m even thankful to you. Оwing to you I’ve done a big jump in php programming.
But on the case…
The example with films and actors is just for ease explanations of the issue. I have a huge amount of ‘actors’. So multiple select or checkbox is not my choice. I’d like to put into the list field text value ‘title’ or ‘slug’ and then find related pod by this parameters. I’ve already done this such way:
add_filter( 'pods_gf_field_column_row_2_3', 'my_function', 10, 6 );
function my_function($row, $columns, $form, $gf_field, $options, $related_obj) {
$params = array( 'where' => 't.name = "'.$row['name'].'"');
$item = $related_obj->find($params);
$item_id = $iem->first_id();
$row['id'] = $item;
return $row;
}
Unfortunately when I mapped pods field to GF List field there is no [‘id’] key appeared and I had to add it manually.