Error while trying to access collection's fields inside a custom function

Custom Code

Hello,

I have created a custom function that receives 2 lists of documents as arguments.
The return value of the function is a new list that combines values from both of the given lists.
As part of the procedure I've created 2 loops inside the function.
Each loop iterates one of the lists and sets its values with the new list that should be returned.

My issue is when I try to access fields of each of the given lists
I receive the following error message:

"The getter 'tenant_payment_amount' isn't defined for the type 'PropertyTenantsRecord'. Try importing the library that defines 'tenant_payment_amount', "


This is how my 'property_tenants' collection (its a subcollection) looks ('tenant_payment_amount' defined at the bottom):




I'm new to flutter and dart.
I'd appreciate some help.

Thanks in advance :)



What have you tried so far?

I've tried to change the definition from Document to DocumentReference... I thought maybe it will help.. but it created new issues

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