always include field in REST model PUT operation, even if it hasn't changed

  • 1
  • Question
  • Updated 7 months ago
  • Answered
My REST api requires that I include a field for certain update (PUT) operations, even if that field hasn't changed. How can I get skuid to send that field in the request body?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Looks like we can use a snippet to do this by setting "Send updated field values..." to "As custom payload format in request body"
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
You may also be able to accomplish this by adding an entry in the "Body parameters to include with every request" setting, on your data source. Doing this would include it with every POST, PUT, and PATCH requests, but not GET requests.

It can also be added at the URL level, with the "URL Parameters to send with every request" setting.

I'm guessing you've seen the documentation for REST data sources, but just for completeness, here is the link: https://docs.skuid.com/latest/en/data/rest/index.html
Photo of logita

logita

  • 140 Points 100 badge 2x thumb
As above you stated that we can send json body parameter in  "Body parameters to include with every request" setting. I am trying the same.I am making a POST query method call. and sending the json body parameter in datasource body parameter. But its not working.
Is this the correct way to send the body parameter? 
Need help ASAP
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,050 Points 10k badge 2x thumb
Hi Logita,

Can you share any errors you're seeing in the browser console when you try this? You may also find helpful information by opening the browser's Network tab about the request header and body, and the response from the data source. Let us know what you see there, and anything else you have found out about the errors you've seen.