Unable to create feed item within Salesforce Community using flow - Answers - Salesforce Trailblazer Community
Trailblazer Community
Ask Search:
Ana Carolina FerreiraAna Carolina Ferreira 

Unable to create feed item within Salesforce Community using flow

Hello, 

I've been trying to post a message to a community chatter group through flow, but I'm unable to create a feed item record. My use case is: 

We created a custom object and it's being used for approval purposes. Once a user creates a record they should be able to upload one or more files to its related records. After uploading the file(s) the user should click a button that says "Request approval". Another user is gonna approve the record by clicking the "Approve" button, which will change the status value to approved. This value will trigger a process builder that afterwards will trigger a flow. The flow is supposed to post a message (informed by the user when creating the custom object record) to a group chatter within a salesforce community. Since the post to chatter action doesn't allow many customizations such as setting the content that should be posted with the message, I'm using the feed item object. However, the flow won't run successfully when I set the community chatter group as the target. If I set an internal salesforce chatter group as the target it will run smoothly. 

This is the error message I get when trying to run the flow with the community chatter group set as the target group:

INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: You can't share a file from a different community.

Thank you so much!
Ben MervenBen Merven
Since you say it works for internal chatter groups, it's probably due to your salesforce org and your community being different "networks". Basically there is a NetworkId that is used in the background. This is different between your org and your community, and it means certain things cannot be shared across the two. That's why you can't see you community groups anywhere in salesforce proper, and vice versa.

Based on your error it looks like the file is being uploaded and associated with your org, whilst you are trying to feed items record that links it to a post in your community (different "network"). 
Ana Carolina FerreiraAna Carolina Ferreira
Hello, thank you so much for your answer! Can you think of another way of achieving this? I tried to upload the file directly from the community (I created a page and displayed the custom object and the files related list there), but it didn't work either.