---
title: "Internal_InvalidTableRelation"
description: "Internal_InvalidTableRelation"
keywords: "Internal_InvalidTableRelation"
url: "https://myrapidi.com/wiki/internal_invalid_table_relation"
locale: "en"
published: "2024-04-12T15:22:01Z"
modified: "2024-10-16T10:50:36Z"
---

&nbsp;The below error will be displayed when you are writing into a table in Business Central and the provided value is not accepted by Business Central. This is usually caused by those scenarios where the field is a picklist field in Business Central and it does not accept a value that's outside of the allowed list. In order to fix it, you would need to send the right one or build a formula to extract the data in the expected format:&nbsp;  
  
  

The REST service returned a status code that is not 20x - i.e. not OK - Status code received: 400 Bad Request Response body: {"error":{"code":"Internal\_InvalidTableRelation","message":"**The field Country/Region Code of table Contact contains a value (CANADA) that cannot be found in the related table (Country/Region**). CorrelationId: ecb62be5-fde8-4310-9137-e46981d6eae1."}} Data Sent to REST service: {"Mobile\_Phone\_No\_U2S":null,"Fax\_No":null,"E\_Mail":"abc@ymail.com","Type":"Person","First\_Name":"Name","Surname":"Surname"," **Country\_Region\_Code":"Canada**","County":null,"Company\_No":"CT00000","Salesperson\_Code":"INT'L","Home\_Page":null,"ABC\_Product\_Groups":null}  
  
You have 2 options:&nbsp;  
  
1. Turn the field into a picklist in both systems so the data will match;  
2. Add a formula to extract the correct data from other tables/objects: ##DBLOOKUP('DESTDS','CountriesRegions','Name',"MailingCountry",'Code') where you perform a lookup on a destination table called "CountriesRegions" and if Name = MaillingCountry, the result will be the Code. And the 'Code' will be value that you need.&nbsp;
