How to pull the SharinPix Token onto my object? (Developer-oriented)

Tip: 

For more information on how to automatically generate SharinPix tokens for image upload, refer to the following article:

SharinPix automatic token generation (Admin Friendly)

Access the SharinPix Token from the parent object

Note:

In the present context, the Work Order object is referred to as the Parent Object.

  • Create a lookup relationship

In order to pull out a field value from the SharinPix Album object onto a parent object(Account), a Lookup Relationship from the SharinPix Album object towards the Parent Object needs to be created.

  • Create a Flow that updates the related parent record when a SharinPix album is created.

Creating the Flow

  • Go to Setup. In the Quick Find Box, type Flows.
  • Under Process Automation, select Flows.
  • Click on the New Flow button.
  • Select the option Record-Triggered Flow, and click on the Create button
  • After clicking on Create, the Configure Start modal will be displayed. Fill in the modal as indicated below:
    • Select Object: SharinPix Album
    • Configure Trigger: A record is created
    • Leave the remaining parameters as they are.
  • Next, add an Update Triggering Record element.
  • On the Update Triggering Record modal, enter the following information:
    • LabelUpdate SharinPix Token Fields
    • How to Find Records to Update and Set Their Values: Specify conditions to identify records, and set fields individually
    • Object: Work Order
    • In the Field Account Records section:
      • Condition Requirements to Update Record: All Conditions Are Met (AND)
      • Field: Id
      • Operator: Equals
      • Value: {!$Record.Work_Order__c}
    • Add the following entries in the Set Field Values for the Account Records section:
      1. For the Field, select the SharinPix_Token_Part_1__c field, for the Operator select Equals, and for the Value select {!$Record.sharinpix__SharinPix_Token_Part_1__c}
      2. For the Field, select the SharinPix_Token_Part_2__c field, for the Operator select Equals, and for the Value select {!$Record.sharinpix__SharinPix_Token_Part_2__c}
      3. For the Field, select the SharinPix_Token_Part_3__c field, for the Operator select Equals, and for the Value select {!$Record.sharinpix__SharinPix_Token_Part_3__c}
  • Click on Done to save and activate the Flow.

DEPRECATED: Creating the Process Builder

Note:

This section is deprecated and only used for Process Builder maintenance.

  • Go to Setup. In the Quick Find Box, type “Process Builder”.
  • Under the section Process Automation, select Process Builder.
  • Click on the button New.
  •  Fill in the fields as shown below:
  1. In the Process Name, enter the name for your process. (In this context, it is Update SharinPix Token Fields on Work Order).
  2. The API Name will then generate the API name of the process name.
  3. Enter a description of the process. (optional)
  4. In The process starts when the field, select A record changes.  
  5. Then click Save.

The Process Builder will then open.

  • Click on Add Object.
  • On the right-hand side, under Object, select an object related to the current one, in this context it is Work Order.
  • Start the Process: Only when a record is created.
  • Click Save.

Select Add Criteria.

When the right-hand-side appears:

  • In the field Criteria Name, enter the name for the Criteria.
  • Under Criteria Executing Actions, select No criteria-just execute the actions!

Click on Add Action.

When the right-hand-side appears:

  • In the Action Type field, select Update Records.
  • Give a name to the action inside the Action Name field. In this case, it is Update SharinPix Token Fields.
  •  Inside the Record Type field:
    1. For Select a Record to Update, choose Select a record related to the sharinpix__SharinPixAlbum__c.
    2. Inside Type to filter list, choose Work Order.
  •  For Criteria for Updating Records, choose No criteria—just update the records! 
  • Inside Set new field values for the records you update :
    1. Select SharinPix Token Part 1 with Type Field Reference and Value which references the field SharinPix Token Part 1 of the related Object with is SharinPix Album in our context. (In this case, it is sharinpix__SharinPixAlbum__c .sharinpix__SharinPix_Token_Part_1__c).
    2. Select SharinPix Token Part 2 with Type Field Reference and Value which references the field SharinPix Token Part 2 of the related Object with is SharinPix Album in our context. (In this case, it is sharinpix__SharinPixAlbum__c .sharinpix__SharinPix_Token_Part_2__c).
    3. Select SharinPix Token Part 3 with Type Field Reference and Value which references the field SharinPix Token Part 3 of the related Object with is SharinPix Album in our context. (In this case, it is sharinpix__SharinPixAlbum__c .sharinpix__SharinPix_Token_Part_3__c).
  • Click Save.

Save. Then, in the upper right corner, Activate. 

You can now access the SharinPix Token on the Work Order object.

0 Comments

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.