Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Drawyiana
New Member

Facebook: (#100) Tried accessing nonexisting field (comments) on node type (Page)

Hello Power BI Community,

 

I could solve the problem by entering the code:

 

let
    Source = Facebook.Graph("https://graph.facebook.com/v2.8/microsoftbi/posts?limit=100"),
    #"Expanded object_link" = Table.ExpandRecordColumn(Source, "object_link", {"connections"}, {"object_link.connections"}),
    #"Expanded object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link", "object_link.connections", {"comments"}, {"object_link.connections.comments"}),
    #"Expanded object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections", "object_link.connections.comments", {"created_time", "from", "message", "id", "object_link"}, {"object_link.connections.comments.created_time", "object_link.connections.comments.from", "object_link.connections.comments.message", "object_link.connections.comments.id", "object_link.connections.comments.object_link"})
in
    #"Expanded object_link.connections.comments"

 

But now my question is, if I can also see the replies of the comments? Is there another code?

 

So my desired order would look like this:

 

Post -> Comment -> Replies to the comments 

 

Kind of like this:

 

help.JPG

But I would also like to see all replies, so not only one single reply.

 

Regards

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
Employee

Hi @Drawyiana,

 

After getting all Posts, please expand corresponding items following below sequence:

object_link

-> object_link.connections

-> object_link.connections.comments

-> object_link.connections.comments.object_link

-> object_link.connections.comments.object_link.connections

-> object_link.connections.comments.object_link.connections.comments

-> object_link.connections.comments.object_link.connections.comments.message

 

let
Source = Facebook.Graph("xxxxxxxx"),
#"Expanded object_link" = Table.ExpandRecordColumn(Source, "object_link", {"connections"}, {"object_link.connections"}),
#"Expanded object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link", "object_link.connections", {"comments"}, {"object_link.connections.comments"}),
#"Expanded object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections", "object_link.connections.comments", {"object_link"}, {"object_link.connections.comments.object_link"}),
#"Expanded object_link.connections.comments.object_link" = Table.ExpandRecordColumn(#"Expanded object_link.connections.comments", "object_link.connections.comments.object_link", {"connections"}, {"object_link.connections.comments.object_link.connections"}),
#"Expanded object_link.connections.comments.object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link.connections.comments.object_link", "object_link.connections.comments.object_link.connections", {"comments"}, {"object_link.connections.comments.object_link.connections.comments"}),
#"Expanded object_link.connections.comments.object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections.comments.object_link.connections", "object_link.connections.comments.object_link.connections.comments", {"message"}, {"object_link.connections.comments.object_link.connections.comments.message"})
in
#"Expanded object_link.connections.comments.object_link.connections.comments"

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yulgu-msft
Employee
Employee

Hi @Drawyiana,

 

After getting all Posts, please expand corresponding items following below sequence:

object_link

-> object_link.connections

-> object_link.connections.comments

-> object_link.connections.comments.object_link

-> object_link.connections.comments.object_link.connections

-> object_link.connections.comments.object_link.connections.comments

-> object_link.connections.comments.object_link.connections.comments.message

 

let
Source = Facebook.Graph("xxxxxxxx"),
#"Expanded object_link" = Table.ExpandRecordColumn(Source, "object_link", {"connections"}, {"object_link.connections"}),
#"Expanded object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link", "object_link.connections", {"comments"}, {"object_link.connections.comments"}),
#"Expanded object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections", "object_link.connections.comments", {"object_link"}, {"object_link.connections.comments.object_link"}),
#"Expanded object_link.connections.comments.object_link" = Table.ExpandRecordColumn(#"Expanded object_link.connections.comments", "object_link.connections.comments.object_link", {"connections"}, {"object_link.connections.comments.object_link.connections"}),
#"Expanded object_link.connections.comments.object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link.connections.comments.object_link", "object_link.connections.comments.object_link.connections", {"comments"}, {"object_link.connections.comments.object_link.connections.comments"}),
#"Expanded object_link.connections.comments.object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections.comments.object_link.connections", "object_link.connections.comments.object_link.connections.comments", {"message"}, {"object_link.connections.comments.object_link.connections.comments.message"})
in
#"Expanded object_link.connections.comments.object_link.connections.comments"

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you so much! I finally can see all replies to one post.

 

Is there also the possibility to see the user names / id´s of the repliers?

 

Regards,

 

Sebastian

Hi @Drawyiana,

 

object_link

-> object_link.connections

-> object_link.connections.comments

-> object_link.connections.comments.object_link

-> object_link.connections.comments.object_link.connections

-> object_link.connections.comments.object_link.connections.comments

-> object_link.connections.comments.object_link.connections.comments.from

-> object_link.connections.comments.object_link.connections.comments.from.name

1.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yulgu-msft,

 

Thanks for replying. Your answer also helped me on one of my dashboards.

 

Would you mind helping me aswell? I would like to get information on the users who comments on my page's posts, such as: gender, hometown, age, etc.

 

Any ideas?

Drawyiana
New Member

Hello Power BI Community,

 

I could solve the problem by entering the code:

 

let
    Source = Facebook.Graph("https://graph.facebook.com/v2.8/microsoftbi/posts?limit=100"),
    #"Expanded object_link" = Table.ExpandRecordColumn(Source, "object_link", {"connections"}, {"object_link.connections"}),
    #"Expanded object_link.connections" = Table.ExpandRecordColumn(#"Expanded object_link", "object_link.connections", {"comments"}, {"object_link.connections.comments"}),
    #"Expanded object_link.connections.comments" = Table.ExpandTableColumn(#"Expanded object_link.connections", "object_link.connections.comments", {"created_time", "from", "message", "id", "object_link"}, {"object_link.connections.comments.created_time", "object_link.connections.comments.from", "object_link.connections.comments.message", "object_link.connections.comments.id", "object_link.connections.comments.object_link"})
in
    #"Expanded object_link.connections.comments"

 

But now my question is, if I can also see the replies of the comments? Is there another code?

 

So my desired order would look like this:

 

Post -> Comment -> Replies to the comments 

 

Kind of like this:

 

help.JPG

But I would also like to see all replies, so not only one single reply.

 

Regards

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.