Forum Discussion

salih7's avatar
salih7
New Member
1 year ago
Solved

Dynamics 365 Expression.Error: Access to the resource is forbidden.

I am fetching data from Dynamics with the M query  let Source = OData.Feed("https://jcl-prod.operations.dynamics.com/data", null, [Implementation="2.0"]), FilterSampleRows = Table.SelectRows(Sourc...
  • v-sgandrathi's avatar
    1 year ago

    Hi salih7,
    Thanks for using Microsoft Fabric Community Forum.

    To resolve the "Expression.Error: Access to the resource is forbidden" error you're encountering in your query, we recommend the following approach:

    First, we can verify if each table is accessible before attempting to expand its data. This can be achieved using the try...otherwise construct in M language, which checks the accessibility of the Data column for each table. If the expansion of the Data column is successful, the table will be marked as Accessible. If the operation fails it will be marked as Not Accessible.

    We will then add a new column, AccessStatus, to indicate whether each table is accessible or not. Afterward, we can filter out the tables marked as "Not Accessible" and expand the "Data" column only for the accessible tables. This process ensures that only the tables which can be expanded will be included in the result, thus avoiding the access error and allowing smooth data retrieval.

    If you need further assistance or have any questions, feel free to reach out.

    Please Accept as solution if this meets your needs and a Kudos would be appreciated.

     

    Thank you.