> For the complete documentation index, see [llms.txt](https://docs.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](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).

# 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:

![](https://1825037175-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNDxbAdc00ce6bH5u1urh%2Fuploads%2Fp6VtwrefPk8Zu0ymjCRt%2Fdownloads.intercomcdn.comio23848225567699bdd602e3bd619558297Capture%2Bd%E2%80%99e%CC%81cran%2B2020-08-21%2Ba%CC%80%2B14.22.26.png?alt=media\&token=0a0c80a6-9d5c-43d6-9579-d42d8664a5f4)

* 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
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>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
