> For the complete documentation index, see [llms.txt](https://docs.fireapis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fireapis.com/the-basics/logics/dynamic-data-source-selection.md).

# Dynamic Data Source Selection

This popup gives you the ability to select your data dynamically from the previous action or input payload.

The Dynamic Data Source Selection popup allows you to customize dynamic data usage wherever needed. Data can be selected from:

* Previous actions
* Input payload
* Environment Secrets Manager
* Decoded tokens (e.g., user tokens)

#### Examples with Screenshots

**Using Email from Input Payload**:

* Select the email from the input payload of the API request.
* Use it for querying the database to check if the user exists.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FnYj0VHgDgFPLmPXV3taj%2Fpayload_selection_using_dyanmic.png?alt=media&amp;token=626b9a03-29fa-46f7-9b87-93526312aed3" alt=""><figcaption><p>Data is taken from input payload</p></figcaption></figure>

**API Key from Secrets Manager**:

* Retrieve the API key for the SendGrid email service from the Secrets Manager.
* Use it securely for sending emails.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2FFntWQ3mlnH6OYLLI9aKW%2Fsecrets_selection_using_dynamic.png?alt=media&amp;token=4e528994-771a-423a-8545-09652d2a232b" alt=""><figcaption><p>Data is taken from secrets manager</p></figcaption></figure>

**Custom User Detail Handling**:

* Take user details from previous actions to build custom text.
* Return a custom object with data derived from the results of previous actions.

<figure><img src="https://3583334649-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdrfsCZXcXll5UVMF1xCv%2Fuploads%2Fk5HfkD3ir7XKCIInHVrL%2Fprevious_action_using_dynamic.png?alt=media&amp;token=b6ed73f0-c8b5-4723-a2e5-3ce1c72f1593" alt=""><figcaption><p>Data is taken from previous action results</p></figcaption></figure>

This popup provides a flexible and intuitive way to manage dynamic data across various actions .
