Filtering through Adalo API GET call and returning id

Options
Hi everyone,

Unfortunately I don't know enough to know if this question (or similar) has already been answered. I am trying to return the id number of an Adalo collection.

After I perform a GET call in XANO on the Adalo collection, I would like to filter through the result for the collection that has the property "User_Expense_ID" that is equal to my Input "User_Expense_ID", and then return the id of that collection. I hope the screen shot provides a clearer picture of what I am talking about.
[Xano_Screenshot.jpg]
Kind Regards!

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    If I am understanding your question right, I think the short version is: 
    1) Create a variable called "output" that is a simple integer, 
    2) set up a "for each" over response.result.records and call the iterator "item"
    3) WIthin the for-each, do an "if" to see whether the "item.user_expense_id" is equal to your input, "user_expense_id"
    4) Within the "then", update the output to the value of "item.id"
    5) Break the loop
    6) Hooray, output now contains your ID!
    7) if this is the job of the endpoint, return output as self!