Forum Discussion
Error in some rows for ExpandRecordColumn with no data
- Anonymous2 years ago
Hi Blue407 ,
You can handle this situation in Power Query by using the and functions to catch errors and return instead.= Table.TransformColumns( Table.ExpandRecordColumn(#"Changed Type", "Manager", {"id"}, {"Manager.id"}), {"Manager.id", each try _ otherwise null} )This code will attempt to expand the “Manager” column and, if an error occurs (such as when there is no manager assigned), it will replace the error with nulll.
You can open the advanced editor to replace this code with the previous one, but of course you need to be careful that the contextual references are correct.Best regards,
Albert HeIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi Blue407 ,
You can handle this situation in Power Query by using the and functions to catch errors and return instead.
= Table.TransformColumns(
Table.ExpandRecordColumn(#"Changed Type", "Manager", {"id"}, {"Manager.id"}),
{"Manager.id", each try _ otherwise null}
)
This code will attempt to expand the “Manager” column and, if an error occurs (such as when there is no manager assigned), it will replace the error with nulll.
You can open the advanced editor to replace this code with the previous one, but of course you need to be careful that the contextual references are correct.
Best regards,
Albert He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly