cancel
Showing results for 
Search instead for 
Did you mean: 

How can do I knwo which fields are passed in the payload?

0 Kudos

We are using OData services to update data in Folder (Case) Management. In the implementation we are translating the values passed into a name-values table. Problem is now that when the structure contains an empty value, we don't know whether the value is not passed (no update in folder management), or the value is passed as initial and needs to be updated in folder management.

How can I find out which fields are passed in the payload with the POST and/or the PUT action?

The PATCH could be a solution, problem is that we do a deep-insert most of the time to prevent locking. PATCH is not allowed for deep-insert.

Regards,
Paul Lauwers.
Application Engineer at IFF

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188585
Participant
0 Kudos

Hello Paul,

Can you explain you requirement with an example?

Cheers

~Rahul

0 Kudos

To update folder management, we have to translate the values passed into an internal table called with name/value. The internal table is used to update the folder.

If my entity set has the following fields:

{

   "d" : {

     "DescriptorId" : "0000000001",

     "DescriptorName" : "AGREST",

     "GrapheColor" : "CB8C52",

     "MaterialFlag" : ""

   }

}

I translate the fields into the internal tables:

Name                    Value

DescriptorId          0000000001

DescriptorName    AGREST

GrapheColor         CB8C52

The last field MaterialFlag is not appended into the internal table because of the initial value. In the above payload the value is passed and it should have been appended with initial value so that it would be updated to initial. However when the payload was:

{

   "d" : {

     "DescriptorId" : "0000000001",

     "DescriptorName" : "AGREST",

     "GrapheColor" : "CB8C52"

   }

}

The MaterialFlag should not have been appended. I would like to know which fields are passed in the payload to determine whether the field needs to be appended.

Regards,