Is there any way to fetch a database's object through mapping?

Options

I’d like to ask for your help. I’m trying to generate a text file using CRON/Task in Xano. Here’s the flow:

As an example, I have a database called users and I’ll be looping through each of the user in the users. For each user, they have the following:

{

username,

email,

transactions: {

amount,

vat,

refund_amount

   }

}

My text file has this format:

=====

Header

Details

Footer

=====

As an example for the format:

=====

FILE 02132023 (Header which contains the current date when the file was generated)

Username 1500.00 5% (Details which contains the username, amount, and vat)

000000000 (Footer which contains a string of 0s)

=====

I generate the details for the text file using lambda function by mapping through each user in the users database, however I’m having a hard time in fetching the data inside the object, which is transactions, in lambda. Whenever I generate the file, it returns a null data. Is there any way to fetch the data inside an object through mapping? I have tried setting the object as a variable however it returns the all of the users’ transactions instead of the specific user’s own transaction data. Thank you so much.

Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Hi! Can you share your function stack and lambda via screenshots or a screensharing video (e.g. Loom)? You could get more help faster!

  • chrstnstl
    Options

    Here's the db and here's the lambda function.

    We've tried item.vatvee.mandate_start however it didn't work.

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Is there anything in the vatvee member? I would use stop-and-debug after you run the query to see what the actual output is before feeding to the lambda.