Custom Action Not Returning Expected Data in FlutterFlow

Custom Code

I'm encountering an issue with a custom action in FlutterFlow that's designed to extract the greenFlags list from a JSON object (apiResultb86). Despite implementing the function, it consistently returns an empty list, indicating that the data isn't being processed as expected.

Upon print to console, I noticed that the apiResultb86 received by the custom action is empty.

However, the previous supabase query row action that populates apiResultb86 works fine and i see the following data in it

{ "id": "e53d9d6d-8c82-433c-8927-67a9c75201ab", "created_at": "2025-03-25T22:30:44.637+00:00", "personID": 3, "greenFlags": ["Secure in Themselves", "Emotionally Regulated", "Emotionally Available", "Good Listener"], "redFlags": ["Vague About Life", "Pressures for Intimacy"] }

What have you tried so far?
  1. Function Implementation: Defined the newCustomAction function to check for the presence of the 'greenFlags' key and return its value as a list of strings:

    Future<List<String>> newCustomAction(Map<String, dynamic> apiResultb86) async { if (apiResultb86.containsKey('greenFlags') && apiResultb86['greenFlags'] is List) { return List<String>.from(apiResultb86['greenFlags']); } else { return []; } }

  1. Debugging with Print Statements: Inserted print statements to monitor the function's behavior and inspect the incoming data:

    print('Received apiResultb86: $apiResultb86');

Console Output:

Received apiResultb86: {} apiResultb86 is a Map with keys: () greenFlags key not found

  1. Data Verification:

  • Expected Input Structure:

    { "id": "e53d9d6d-8c82-433c-8927-67a9c75201ab", "created_at": "2025-03-25T22:30:44.637+00:00", "personID": 3, "greenFlags": ["Secure in Themselves", "Emotionally Regulated", "Emotionally Available", "Good Listener"], "redFlags": ["Vague About Life", "Pressures for Intimacy"] }


    Actual Received Data: An empty map {}.

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