# Missing vendors or purposes in the consent string or when using the \_\_tcfapi() function

When using the \_\_tcfapi() function, you will sometimes find that some vendors or purposes are missing. Generally, this is not a bug: this is due to TCF V2 functional specifications.

When you go to the preference view and make a granular choice, the function will return values at "**True**" or "**False**" for purposes. The list will be created starting from ID 1 and ending with the last vendor or purpose with a "**True"** value.

If this last purpose with a "**True**" value has an ID inferior to 10 (last purpose ID) and others have a "**False**" status, then the list of purpose displayed in the \_\_tcfapi() function and the consent string will end with this last purpose with a "**True**" value. Following purposes with a superior ID will not show as their status would be at "**False**".

* For example, if you make the following choice on the preference view:

![](/files/YRWVzRp2AbxTt11koM1f)

* The tcfapi() function will return the following result:

```
purpose: {
	consents: {
		1: true
		2: false
		3: true	
		4: true
		5: true
		6: true
		7: true
	}
	legitimateInterests: {
		1: false
		2: false
		3: true
		4: true
		5: true
		6: true
		7: true
	}
}
```

* The consent string will have the following values:

```
"purposeConsents": { 
	"1": true, 
	"3": true, 
	"4": true, 
	"5": true, 
	"6": true, 
	"7": true 
}, 
"purposeLegitimateInterests": { 
	"3": true, 
	"4": true, 
	"5": true, 
	"6": true, 
	"7": true 
}
```

* Same behavior will occur when making granular choices on the vendors' view.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.didomi.io/consent-management-platform-cmp/frameworks-regulations/iab-tcf/missing-vendors-or-purposes-in-the-consent-string-or-when-using-the-__tcfapi-function.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
