Forum Discussion
Web.Headers using MS Graph to handle (expected) HTTP-errors seems not possible. Any suggestions?
The situation for now. I have 2 rows from web.contents. One results with a binary containing a usefull JSON, the second row results in 'Expression.Error: Access to the resource is forbidden'. I would like to filter that one out, so the rest of the query steps will have not a problem from that record.
I tried your suggestion but using web.headers always returns a 405 error, so also for the 'healthy' records from which a web.contents would generate a usefull JSON. So in my opinion Graph does not seem to support the web.headers function at all. From there filtering on web.headers is not possible.
But using web.contents generate an expression.error for some records, from which I cannot proceed with the other query step. I asked chat.openai who advised me to use the following code, which looks very logical. But this check returns an unexpected TRUE also for the record containing the expression.error. So it is a valid JSON, but the error is stopping any further steps.
#"Added Custom" = Table.AddColumn(Source, "ValidBinary", each try Value.Type([JSON2]) = type binary otherwise false)
Hi ArjanvanLoon
I don't think you can filter the "forbidden" error record out, because I THINK whenever PQ tries to evaluate the record for filtering purposes, it will hang in the credentials...
IMO you have to make sure there is no forbidden record there.
Others are of course free/invited to jump in anytime and help fix the issue