I’ve got a use case where I though it should be easy to achieve, but I cannot quite seem to get there. I want to present a user with a list of items, and get a check box response for each item. Would look like this:
UserID: xxxxx
Area / Available
a / Y
b / N
c / N
d / Y
The “areas” are stored in a database table, and can be fetched once the User ID is filled in. The problem is that which areas need to be shown and the number of them can differ for each user.
Tried working with Populate Anything, but no matter what I try, it only populates the first area record it finds.
I searched Perks, and found “Auto List Field”, which sounded perfect figuring I could populate a field with the record count. Can’t figure out how to do that with populate anything (would be really nice if you could execute a SQL statement), nor can I get Populate Anything to fill in the fields (using Auto Field List on a list control, I placed a numeric field on the form, manually set it, would get the rows I wanted, but could not get them filled).
I also searched for snippets and found one that I thought was going to do the trick, but it flattened multiple records into a single field ( snippet-library/gp-populate-anything/gppa-populate-all-results.php at master · gravitywiz/snippet-library · GitHub ) rather than creating multiple rows.
Have hunted and hunted and come up with things that are close, but not quite what I need. I’m relatively new to GF, PHP, etc., so just may not be seeing the answer.
I did come up with a solution I think would work, but l would need the record count populated in a field. Since I can control the design of the table, I could number the records for each user with a “Row ID”. i.e.
User / Row ID /Area
123456 / 1 / a
123456 / 2 / b
123456 / 3 / c
123456 / 4 / d
456 / 1 / x
456 / 2 / y
On the form then, I would have a series of pre-defined list controls (say 20), populating each list field using the UserID and the row, and show only the ones needed for the user (Show this field if row<= Hidden Record Count). This would also allow me to have multiple columns by adding additional fields for the row. I need the Y/N “Available” for now, but in the future, there might be additional columns.
Anyone have any thoughts on how I might achieve this?
Thanks,
Jim.