1

I need to change an existing flow and add a function to it to add or change the sharing of records that are private in OWD to read/write with a public group. I know it's easy with apex but my customer wants it done with Flow if possible. Anyone know how to do this?

2
  • You can create a custom checkbox field on Object and mark it checked in flow. Later, create a sharing rule that will check the checkbox and share the record with group of users. Commented Feb 26, 2016 at 8:33
  • Thanks, but I need it to share dynamically based n field in the record
    – Saskiah
    Commented Feb 29, 2016 at 8:28

1 Answer 1

2

It's probably easier with Apex but it can be done with Flow also. Follow these steps:

  1. Create an Apex Sharing Reason on your chosen object, say 'Yourobject': Setup > Build > Create > Objects > Yourobject and then click the 'New' button in the Apex Sharing Reasons related list

  2. Now create a Flow: Setup > Build > Create > Workflows & Approvals > Flows. On the Canvas, create two text variables: VarT_YourobjectId and VarT_YourgroupId.

  3. Now have the flow create a record on the Yourobject_Share object. This object is related to Yourobject and stores all sharing records. Drag and drop the Record Create element onto the Flow Canvas. A window will open where you enter a name for your flow.

    In the Accesslevel field on the Canvas, choose the access level for Yourgroup

    In the ParentId field, choose the VarT_YourobjectId variable from the picklist

    In the UserOrGroupId, choose the VarT_YourgroupId variable from the picklist

    In the Rowcause field, choose the Apex sharing reason you created from the Picklist Values

  4. Now, save your Flow and create a process with Process Builder that invokes your Flow. You map the Flow variables that you created to the fields on Yourobject that contain the Yourobject Id and the group Id you need to share the record with.

5
  • This way I can share dynamcally? Based on a field in the record?
    – Saskiah
    Commented Feb 29, 2016 at 8:27
  • Yes, you can share with a user or group, provided that the id is stored in your object
    – user28311
    Commented Feb 29, 2016 at 8:52
  • I've been doing exactly as you said, but it is not working, and no no error message
    – Saskiah
    Commented Feb 29, 2016 at 13:55
  • Can you see in the debug log what happened? You have set the workflow picklist to 'finer'
    – user28311
    Commented Feb 29, 2016 at 15:06
  • It's working! It was not activated (thought I did) Thanks Fred
    – Saskiah
    Commented Mar 1, 2016 at 8:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .