Is there any way to fetch a database's object through mapping?
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
-
Hi! Can you share your function stack and lambda via screenshots or a screensharing video (e.g. Loom)? You could get more help faster!
-
Here's the db and here's the lambda function.
We've tried item.vatvee.mandate_start however it didn't work.
-
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.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback