External API Request via function with input queried from database
Options
![David -2769322](https://us.v-cdn.net/6037124/user_avatars/2769322.jpg)
David -2769322
Member ✭
I am building a function that would be fired from an incoming post that would take some of the input data in addition to retrieve some data from database tables in Xano to ultimately compile a post request with these compiled values. Below is example of the data needing to be compiled (and not the entire API request). How would this POST request be compiled given the mix of text and variables using the External API Request:
{
"shipping_method": "string",
"recipient": {
"name": "",
"address": {
"address1": "",
"address2": "",
"city": "",
"state": "",
"country": "",
"zip_code": ""
},
"email": "",
"phone_number": ""
},
"products": [
{
"id": ,
"quantity":
}
],
"reference_id": "",
"order_number": "",
"purchase_date": "",
}
{
"shipping_method": "string",
"recipient": {
"name": "",
"address": {
"address1": "",
"address2": "",
"city": "",
"state": "",
"country": "",
"zip_code": ""
},
"email": "",
"phone_number": ""
},
"products": [
{
"id": ,
"quantity":
}
],
"reference_id": "",
"order_number": "",
"purchase_date": "",
}
Comments
-
Hy - you'll see Xano allows for a mix of values - which can be from variables, inputs, text, etc...
The data you require first from the database should first be retrieved in the function stack with a database request... then you can use dot notation on the variable to add this data dynamically to the body of your API request
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