hawki - @Gaurav Chadha hey 👋 quick question: d...
@Gaurav Chadha hey 👋 quick question: do you know why this node is writing ‘undefined’ to my Firestore DB despite using the right variable as an argument? Any help would be hugely appreciated
Solution:Jump to solution
Yes, simply add more parameters to the request body and each parameter can be accessed with their key
`{
"key1": "value1",
"key2": "value2",...
7 Replies
@hawki In your request body, you'll need to remove the body key object,
simply provide this as body:
{
"pending": "you text"
}
Can I set the pending status to be dynamic based on the parameter I pass through the body code?
This will change depending on what is sent to this particular API
There will be other parameters passed in too, as well as the pending parameter and I’ll need to determine where in the json to use them
yeah, it is already dynamic as you are using a variable (body). it will take the value you sent to it from your client side.
Ok, but is it possible to access the parameter within the body? I intend to send a single body code with multiple parameters in and use the parameters to write to individual fields within a Firestore document.
Sorry, probably missing something obvious here!
Solution
Yes, simply add more parameters to the request body and each parameter can be accessed with their key
{
"key1": "value1",
"key2": "value2",
}
Ah ok I must’ve been overcomplicating it. I’ll give it a try
Yep, I see now. Noob mistake. Thanks for your help @Gaurav Chadha ! 🙏