Custom action - take document reference as input, look up Firebase document, return document column

Custom Code

Hi All,

I'm trying to code a custom action that will take a Firestore document reference, look up the document, and then return a value from that document.

I found a video (link) which explains how to look up the document and return the document itself from a custom action (see my version of the code below). However, I don't want to return the document - I want to return a specific column (in my case, Categories column from Usercategories collection); can anyone advise on how to do that?

Current code:

Future<UsercategoriesRecord> getcategorydoc( DocumentReference? categoryref) async { return UsercategoriesRecord.getDocumentOnce(categoryref!);

}

What have you tried so far?

I've tried searching this forum and the Internet in general

Did you check FlutterFlow's Documentation for this topic?
Yes
1
2 replies