
visited doc but not get any idea,

Basically you create one to make a specific thing with your data or backend and then you trigger it to be executed from an app, an event (database, Auth), manually or scheduled

any basic idea if you can provide like what is happening in this function or what is use for res and req and how to trigger on event or create document from function ```Future<void> start(final req, final res) async { final client = Client();
//Uncomment the services you need, delete the ones you don't final account = Account(client); final avatars = Avatars(client); final database = Databases(client); final functions = Functions(client); final health = Health(client); final locale = Locale(client); final storage = Storage(client); final teams = Teams(client); final users = Users(client);
if (req.variables['APPWRITE_FUNCTION_ENDPOINT'] == null || req.variables['APPWRITE_FUNCTION_API_KEY'] == null) { print( "Environment variables are not set. Function cannot use Appwrite SDK."); } else { client .setEndpoint(req.variables['APPWRITE_FUNCTION_ENDPOINT']) .setProject(req.variables['APPWRITE_FUNCTION_PROJECT_ID']) .setKey(req.variables['APPWRITE_FUNCTION_API_KEY']) .setSelfSigned(status: true); }
res.json({ 'areDevelopersAwesome': true, }); }```

What it makes is showing a response who is 'areDevelopersAwesome': true

What's inside the Future<void> function is what's executed

Other things are requests made to start appwrite services. You can delete what you will not use

do you have any idea for creating document from function so that i can create 10 document in just single click ?

Same as you would have done with flutter: run this 10 times for each document you need to create:
import 'package:appwrite/appwrite.dart';
void main() { // Init SDK
Client client = Client();
Databases databases = Databases(client);
client
.setEndpoint('https://cloud.appwrite.io/v1') // Your API Endpoint
.setProject('5df5acd0d48c2') // Your project ID
;
Future result = databases.createDocument(
databaseId: '[DATABASE_ID]',
collectionId: '[COLLECTION_ID]',
documentId: '[DOCUMENT_ID]',
data: {},
);
result
.then((response) {
print(response);
}).catchError((error) {
print(error.response);
});
}

If I'm not wrong, currently it's not possible to bulk-create documents, so you will need to trigger the above code the same amount of times as documents you will need. However such feature has been suggested: https://github.com/appwrite/appwrite/issues/3051
You can give it a 馃憤
Recommended threads
- ENV vars not updating
When i do `nano .env` it shows `_APP_DOMAIN_TARGET=` as set to my domain, but when i do `docker compose exec appwrite vars` it shows `_APP_DOMAIN_TARGET=` as ...
- Index with the requested key already exi...
I'm using appwrite cli to create DB and I'm getting index_already_exists Is there a way to undestand the index name and maybe to skip if it's already exits?
- Hola equipo de soporte,
Hola equipo de soporte, Estoy desarrollando una Function en Appwrite Cloud con Node.js 22 y el siguiente package.json: {聽聽"name":聽"upload-whitelist",聽聽"type"...
