Jump to content

Recommended Posts

Posted

Hello,

 

I want to put some data in a table field, but if I put the label of the first table field, it gives an error:  Item 'feature' set to TableRows is not an allowed type

Here is my code:

	foreach ($fetchAll as $fetch => $feature) {
						$productid = $feature["id_product"];
						$pages = wire("pages")->get("productid=$productid");
						$pages->of(false);  // ensure output formatting is off
						$pages->Specification->feature = ($feature['name']);
						$pages->Specification->value = ($feature['value']);
						$pages->save();
					}

I tried to give the label other names, but it still doesn't work. How can this be solved?

Posted

Have you read the API instructions for adding rows to tables in the Profields Table support board? Are you trying to update existing rows, or insert new ones?

The first thing I notice though is that you are overwriting the $pages variable to one specific page and also getting that page in every step of your loop.

Also, please don't reply here, but rather re-post this question in the Table support board with some more details as I mention above.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...