Hello, I am trying to use HTTP Post/REST API to create a new row in an AppSheet child table (this is a google sheet). The child table has a column that is a REF type to the parent table (this is a different google sheet). The REF column in the child table is the ParentID value to relate the row to the parent table.
My HTTP Post action is attempting to upload the new row in the child table with the correct ParentID value (for an existing parent table row with matching ParentID value). However, Appsheet is rejecting/erroring on the HTTP Post/Add action:
EXA of the HTTP Post Action:
Hi @questionguy555 !
The issue is that AppSheet REF fields expect the label value or key value as defined in the parent table, not just any ID.
Please check in the parent table:
-Make sure the "ParentID": "12232de8" you send in the API call matches that key or label value (not necessarily the raw spreadsheet row ID).
You can also test adding the row manually in AppSheet and check what value shows up in the ParentID field — that’s the value your API should send.
"You can also test adding the row manually in AppSheet and check what value shows up in the ParentID field — that’s the value your API should send."
the value that shows up in the ParentID field is the exact same value I am using 😞
the value I am using is the key value in the Parent table (the label is different)
The error indicates that the ParentID value being provided in your HTTP POST request doesn't match any existing ParentID in the parent table. The ParentID column in your child table must reference a valid key from the parent table. Here's how to troubleshoot and fix the issue:
Steps to Resolve
1. Verify the ParentID in the Parent Table
Check the parent table in Google Sheets to ensure that 12232de8 exists as a key in the column used for the REF relationship.
If it doesn’t exist, either create a row with that ParentID in the parent table or update the ParentID in your POST request to an existing key.
2. Check the Column Configurations
In the AppSheet editor:
Ensure that the ParentID column in the child table is set as a REF column.
Ensure that the REF column correctly references the parent table.
3. Ensure Correct Data Formatting
The value of ParentID in the POST request must exactly match the format of the keys in the parent table.
REF keys are case-sensitive, so 12232de8 must match the case of the key in the parent table.
4. Test Your POST Action
Use the AppSheet API test feature or a tool like Postman to manually test the request.
Replace 12232de8 in your request with a known valid ParentID from the parent table to verify that the issue is related to the specific value.
5. Enable "IsAPartOf"
If this is a parent-child relationship, ensure that the IsAPartOf property is enabled in the child table's REF column settings. This allows child rows to inherit valid parent keys and ensures proper relationships.
---
Corrected POST Example
Here’s an updated POST example assuming ParentID is correctly configured:
{
"uri": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"method": "POST",
"headers": {
"ApplicationAccessKey": "xxxxxxxxxxxxxxxxxxxx",
"Content-Type": "application/json"
},
"body": {
"Action": "Add",
"Properties": {},
"Rows": [
{
"ChildID": "c30ff849",
"Date Added": "2025-05-05T10:07:28Z",
"Note": "SCHEDULED - 05/06 at 10am - She needs help with her pool light.\n",
"User": "xxxxxxxxxxx",
"Date Modified": "2025-05-05T14:07:29Z",
"ParentID": "VALID_PARENT_ID_FROM_PARENT_TABLE",
"LastUpdatedBy": "xxxxxxxxx"
}
]
}
}
---
Additional Debugging Tips
1. Log and Confirm Values:
Add logging to confirm that ParentID being passed matches a value in the parent table.
2. Test with AppSheet API Explorer:
Use the AppSheet API Explorer (found in the AppSheet editor under the Manage > Integrations tab) to test your requests and see detailed feedback.
3. Parent Table View Configuration:
Ensure the parent table's key column is visible and not filtered out in the app configuration, as this can cause AppSheet to reject certain keys.
The error indicates that the ParentID value being provided in your HTTP POST request doesn't match any existing ParentID in the parent table. The ParentID column in your child table must reference a valid key from the parent table. Here's how to troubleshoot and fix the issue:
the value i am sending does match the key value in the parent table.
1. Verify the ParentID in the Parent Table
Check the parent table in Google Sheets to ensure that 12232de8 exists as a key in the column used for the REF relationship.
yes i have verified it and it exists
2. Check the Column Configurations
Ensure that the ParentID column in the child table is set as a REF column.
yes it is
Ensure that the REF column correctly references the parent table.
yes it does
3. Ensure Correct Data Formatting
The value of ParentID in the POST request must exactly match the format of the keys in the parent table.
REF keys are case-sensitive, so 12232de8 must match the case of the key in the parent table.
yes it matches perfectly
your post doesn't help me unfortunately
User | Count |
---|---|
17 | |
11 | |
7 | |
5 | |
5 |