Get a Value from an Entry based on another field value.

By: Luis De Pau | Asked: 11/29/2022
ForumsCategory: General questionsGet a Value from an Entry based on another field value.
Luis De PauLuis De Pau asked 1 year ago

Hello! A form has several answers per user.  I'd like to get the values of one field in some of  entries.

For this I have a vew with  Value from entry 1= [frm-field-value field_id=x entry="140"]

Value from entry 4= [frm-field-value field_id=x entry="230"] Value from entry 8= [frm-field-value field_id=x entry="300"]

The Entries have a field (Y) which counts the entry number so the question is: Is there a way to get the Entry ID based on the value of that field (Y)?

Something like

Value from entry 8= [frm-field-value field_id=x entry="[shortcode to get the value when Y="whatever"]"]  

Or is it possible to add other variables to the original shortcode?

Like [frm-field-value field_id=x FieldY="anyvalue"] Thanks a lot! Original kb

1 Answers
Bobby Clapp answered 1 year ago

I shared this snippet:

The only caveat here is that this will only return a single value referenced from an existing unique value. It does not return an array of values, if that is your need.

Luis De PauLuis De Pau replied 1 year ago

I tried before asking, but I couldn't make it work:

I have a view and I need to get the values from 3 entries. Field 606 is the counter and I want to get the value of the field 556 in the first, fourth and eigth answers (out of many).

[get_frmlinked_data field_id=606 where_value="1" associated_field_id=556]
[get_frmlinked_data field_id=606 where_value="4" associated_field_id=556]
[get_frmlinked_data field_id=606 where_value="8" associated_field_id=556]

To use the view I filter it trough a parameter that shows just one user's entries. The problem is that the value it returns is from another user. I guess it is because the 606 value repeats all over the entries (from 1...n)

Any idea would be greatly appreciated!

Bobby Clapp replied 1 year ago

This is not a "many" solution unfortunately. I don't think this will work for you. Is "1" a unique value for field 606? Probably not.

Luis De PauLuis De Pau replied 1 year ago

Thanks a lot Bobby!
I will keep looking for a solution.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community