Skip to main content

Notifications

Business Central forum
Suggested answer

Hiding columns from table in OData API calls

editSubscribe (2) ShareShare
ReportReport
Posted on by 4
We have a security problem with API access to our Business Central database.
We have a table that needs to be accessed by all employees.
That table contains Salary information fields that are hidden in BC but can be accessed via an OData API call from PowerBI or Excell.
I’m pretty sure our company wasn’t setup right, but API access must be maintained for reporting purposes and using linked tables is not a viable solution.
Applying security filters, from BC, to the specific fields doesn’t do the trick, since the hole line gets filtered, and we need it.  
Does anyone know how we can hide fields from API calls while the others, from the same line can still be read?
Thanks
  • Suggested answer
    Saurav.Dhyani Profile Picture
    Saurav.Dhyani 10,155 User Group Leader on at
    Hiding columns from table in OData API calls
    Hi,
     
    You cannot change the field list exposed by a standard API.
     
    If it a custom API Endpoint created by your partner, you can ask them to remove fields that are sensitive and have a separate endpoint for specific people in team to access that data.
     
    If filters need to be applied on data that can also be done by a developer on Custom API Endpoint.
     
    Let me know if you have additional questions, but I think your solution should be simple enough with one or more custom API Endpoints.
     
    Regards,
    Saurav Dhyani
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 60,818 Super User on at
    Hiding columns from table in OData API calls
    Hi, hope the following helps.
    Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
     
    If you are using a Web Service, you can hide this field on the published page so that users cannot see it.
     
    If it is a Flowfield or TableRelation field, it can be managed through permissions.
    More details:
    Dynamics 365 Business Central: What happens if users don’t have permission to read the table set in a FlowField?
    Dynamics 365 Business Central: What happens if users don’t have permission to read the table set in the TableRelation Property?
     
    Thanks.
    ZHU
  • Suggested answer
    Valentin Castravet Profile Picture
    Valentin Castravet 4,483 Super User on at
    Hiding columns from table in OData API calls
    I would create a copy of that API and exclude the salary field in the newly created API. All employees would use the new API. 
     

Helpful resources

Quick Links

Take the Community feedback survey!

Answer this brief 15-question survey about your Community experience…

Demystifying Copilot: Service Edition with Sundar Raghavan

Sundar answers more questions about Copilot for Service...

Dynamics 365 Business Central vs Finance and SCM

Take a look at the key differences between Business Central and…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,375 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 223,308 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,140

Featured topics

Product updates

Dynamics 365 release plans