NetTalk Central

Author Topic: API field override  (Read 2880 times)

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
API field override
« on: March 17, 2020, 01:22:12 PM »
Hi, Bruce

In the API WebService Method template, there is a function to override a field in the view return.  How does this work?  I see you can select a field but where do you put the override value?  Thanks

Wolfgang Orth

  • Sr. Member
  • ****
  • Posts: 251
    • View Profile
    • oData Wolfgang Orth
Re: API field override
« Reply #1 on: March 22, 2020, 07:19:09 AM »
Casey,

I am not in my office righr now, so I have to guess a little.

Do I understand you correct, that you have a table and you want to return this as a view, but this view ought not to ave all fields of the original table, just a limited subset?

Ic ghis is the case, then have a look at the template dialogue, where you arm the VIEW. in my poor memory there is a tab, where you fan pick fields. If none is selected (default), then all fields will be sent. Select /deselect here for a try.

hth
Wolfgang

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: API field override
« Reply #2 on: March 23, 2020, 12:40:18 PM »
Thanks, Wolfgang, but no.

What I am trying to is replace the contents of a field in the table with something that will be meaningful to the programmer/user.  If necessary, I could simply load the table into a queue and add a queue field for the new content, but I thought the field override function might take care of the problem. Thanks again,

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: API field override
« Reply #3 on: March 24, 2020, 09:58:29 PM »
content as in "format picture" or actual generated value?

cheers
Bruce

CaseyR

  • Sr. Member
  • ****
  • Posts: 448
    • View Profile
    • Email
Re: API field override
« Reply #4 on: March 25, 2020, 12:26:09 PM »
The content itself.  In this case, there are several fields in the table that need to be combined and manipulated to create a human readable value.

Thanks.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11194
    • View Profile
Re: API field override
« Reply #5 on: April 06, 2020, 02:28:06 AM »
That overrides tab is there for backward compatibility - the current way to list the fields is on the fields tab. So it's not the solution for what you want Casey.

Rather you can override the contents of the output in the
xml.SaveCurrentFieldToXML
and
json.FormatValue
methods.

cheers
Bruce