Is it possible to Use If statements in Web Services
I was trying to make a conditional web service PATCH. My code is as follows:
[{
"if": [{
"in": ["payroll", ""]
}, {
"op": "replace",
"path": "/attributes/3352",
"value": "13978"
}, {
"op": "replace",
"path": "/attributes/3352",
"value": "13975"
}]
}]
It gives me an error that /"/" opperation is not supported. I don't know if the problem is with the If statement, the In statment, or if these opperations are not possible, or I have this coded wrong. Any help would be greately appreciated.
Answer (1)
Hi Michael,
You are correct in that we do not support that sort operation. I can't say that I have ever seen JSON with an if in statement, but I can say definitively that the TDX REST API has no concept of checking values via a JSON request if section.
For all of our PATCH endpoints, we only support the following the standard PATCH operators:
- Add
- Remove
- Replace
- Move
- Copy
- Test
You can also refer to our generic API documentation for PATCH requests here:
https://api.teamdynamix.com/TDWebApi/Home/AboutPatching
Let me know if this helps.