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

The present article will demonstrate how it is possible to:

* [Access the SharinPix Token from the parent Object](#access-the-sharinpix-token-from-the-parent-object)
* [Use the token to generate a SharinPix Mobile App URL](https://docs.sharinpix.com/documentation/access-and-security/how-to-pull-the-sharinpix-token-onto-my-object-developer-oriented)

{% hint style="success" %}
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)](https://docs.sharinpix.com/documentation/mobile-app/sharinpix-automatic-mobile-upload-token-generation-admin-friendly)
{% endhint %}

## Access the SharinPix Token from the parent object

{% hint style="warning" %}
**Note:**

In the present context, the Work Order object is referred to as the Parent Object.
{% endhint %}

### Update Parent Object when related SharinPix Album is created

* 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

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-e085e82fffeb3bd534c3102946d9b4e3a63985c9%2Fscreenshot-sharinpix-fsl-demo-dev-ed.lightning.force.com-2022.12.26-12_45_01%20\(2\).png?alt=media)

* 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.

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-5790fddc5e887a6c2289612e7ffe9eaacc24feb6%2Fscreenshot-sharinpix-fsl-demo-dev-ed.lightning.force.com-2023.01.22-22_48_52.png?alt=media)

* Next, add an **Update Triggering Record** element.

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-6da4e61523e55a288b62c74edf685ff2531ed595%2Fscreenshot-sharinpix-fsl-demo-dev-ed.lightning.force.com-2022.12.26-12_53_45%20\(2\).png?alt=media)

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-dc3e2858a04f203bab96bc68c106c3a69d88146e%2Fscreenshot-sharinpix-fsl-demo-dev-ed.lightning.force.com-2023.01.22-18_17_06%20\(1\).png?alt=media)

* On the *Update Triggering Record* modal, enter the following information:
  * **Label:** Update 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}**

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-81baa1274e814d9d39a277e08df2134abb844cc0%2Fscreenshot-sharinpix-fsl-demo-dev-ed.lightning.force.com-2023.01.22-22_55_58.png?alt=media)

* Click on **Done** to save and activate the Flow.

#### DEPRECATED: Creating the Process Builder

{% hint style="warning" %}
**Note:**

This section is deprecated and only used for Process Builder maintenance.
{% endhint %}

* 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.

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-a69140bc0da1c8de262d111ef37d19253033d8a5%2Fss1.png?alt=media)

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**.

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-16066cdd8f93463c0064cc3d595c2bc1b6588cd7%2Fss2%20\(1\).png?alt=media)

* 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!**

<figure><img src="https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2F7h4VQSCL6WfEB7tDsZIk%2Fimage%20(30).png?alt=media&#x26;token=20553617-8674-4def-83c0-4ab41d5355cb" alt=""><figcaption></figcaption></figure>

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**.
* &#x20;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.**
* &#x20;For Criteria for Updating Records, choose **No criteria—just update the records!**&#x20;
* 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.

![](https://2221230591-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5EvYRrLbUyvRh8o1jmMG%2Fuploads%2Fgit-blob-cb0d29eaf9f87f973c7b752ba20130644cafa476%2Fss4%20\(1\).png?alt=media)

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

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