Skip to main content
Question

Conditional API_EditRecord Statement

  • June 15, 2017
  • 0 replies
  • 25 views

I am new to xml so I'm having some trouble with a simple if-then statement in my API call.
I want to say, If FieldA is not blank then edit fid 10 on the endpoint table to equal FieldA, else edit it to equal FieldB.  This is my latest attempt.

<qdbapi>
<usertoken>123456789</usertoken>
<rid>34</rid>
<if cond="[FieldA]!=''">
<field fid='10'> [FieldA] </field>
<else/>
<field fid='10'> [FieldB] </field>
</if>
</qdbapi>

Can anyone advise where I'm going wrong?
This topic has been closed for replies.

I suggest that you create a native field which will do the "IF" in your app  and then just have the API use that calculated field.