Skip to main content

Setting up the Propel Integration

Propel

Creating an external client app

  1. Click on the gear icon the top right and click on Setup

  2. Open Apps > external client apps > external client app manager from the left drawer

  3. Click on “New External client app” in the top right.

  4. Enter a name for the app and a contact email

  5. Enable Oauth

  6. Callback url →

  7. Select the following options as the scope of the app

  8. Select the following options and click on create

  9. In the settings tab of the created External client app click on consumer. key and secret

Thumbnail field

  1. In setup go to Object and FIeld → Object Manager

  2. Click on Item Revision (PDLM__Item_Revision__c)

  3. Go to Field & Relationships and click on New

  4. Create a field with

    1. DataType = URL

    2. Field label= ThumbnailURL (With exact casing)

    3. Keep the rest of the options as default and create the field

  5. Create another field with

    1. DataType=Formula

    2. Field label=Thumbnail

    3. Return type = Text

    4. Simple Formula= if(ISBLANK(ThumbnailURL__c),'No thumbnail uploaded',IMAGE(ThumbnailURL__c,'thumb'))

    5. Keep the rest of the options as default and create the item

  6. After the item is created in Fields & Relationship navigate to the “Thumbnail” field you created and copy the field name. In this case it is ThumbnailURL__c

  7. Go to FieldsSet and click on Item Details tab

  8. Search for the Thumbnail field you created and drag it into In the field set

Apex class

  1. In setup go to Custom code > Apex class

  2. Click on new above the table

  3. Paste the following code and click on save

    public class ChangeWebhookInvokerWithAuth {

    public class ChangeData {

    @InvocableVariable
    public Id changeID;

    @InvocableVariable
    public String companyID;

    @InvocableVariable
    public String endpoint;

    @InvocableVariable
    public String authToken;
    }

    @InvocableMethod
    public static void sendWebhook(List<ChangeData> inputList) {

    for (ChangeData input : inputList) {

    sendCalloutFuture(
    input.changeID,
    input.companyID,
    input.endpoint,
    input.authToken
    );
    }
    }

    @future(callout=true)
    public static void sendCalloutFuture(
    Id changeID,
    String companyID,
    String endpoint,
    String authToken
    ) {

    HttpRequest req = new HttpRequest();
    req.setEndpoint(endpoint);
    req.setMethod('POST');
    req.setHeader('Content-Type', 'application/json');
    req.setHeader('Authorization', 'Bearer ' + authToken);

    Map<String, Object> payload = new Map<String, Object>{
    'changeID' => changeID,
    'companyID' => companyID
    };

    req.setBody(JSON.serialize(payload));

    Http http = new Http();

    try {

    HttpResponse res = http.send(req);
    System.debug('Webhook sent: ' + res.getBody());

    } catch (Exception e) {

    System.debug('Webhook error: ' + e.getMessage());

    }
    }
    }

  4. In setup go to Security > Remote Site Settings and click on New Remote Site

  5. Fill the following details and click Save

    1. Remote Site Name = BildWebhook

    2. Remote Site URL =

    3. Disable Protocol Security= Yes

    4. Active=Yes

Webhook

  1. In setup go to Process automation > Flows and click New Flow

  2. Select Triggered and then Record-Triggered Flow

  3. Chose the following options for the trigger. Choose the object, condition requirement, field, operator and values as shown in the below image

  4. Make sure you enable the toggle of Add Asynchronous Path

  5. Click on the Plus Icon below Run Asynchronously

  6. Click on Action and then click on All Actions

  7. Search and Select ChangeWebhookInvokerWithAuth

  8. Set the label to Change Released

  9. Include changeID, companyID, endpoint and authToken

  10. For changeID select Triggering PDLM__Change__C → Record ID and for other fields follow the next case

  11. Get all the values of the following fields

    1. companyID: value will be provided by Bild

    2. endpoint: value(ending with /propel/release) will be:

    3. authToken: Follow the auth token generation steps below in Bild to generate the auth token

  12. For companyID/endpoint/authToken click on the field and select New Resource

  13. Choose Resource Type as Constant.

  14. Type API Name as companyID or BildToken or endpoint (all three individually)
    Select Data Type as Text

  15. Paste the corresponding value you got from the previous step in the input section.

  16. Click on Done and your final screen should looks like this

  17. Click on Save and set the Flow Label to “Change Release Flow”

  18. Click on Activate in the top right corner

Propel - Enabling Client credentials flow

  1. Click on the gear icon the top right and click on Setup

  2. Open Apps > External client apps > External client app manager from the left drawer

  3. Click on the Bild Integration

  4. Click on Edit and Expand OAuth Policies

  5. Enable the client credentials flow and enter the username of the System Administrator

Bild

Integration Setup

  1. Go to settings in Bild in the top right corner and select Integrations from the left panel

  2. Click on Propel card, and confirm to dialog box, you’d be redirected to a new view.

  3. Enter the consumer key, and the consumer secret from the connected app created

  4. Enter you salesforce URL. It should be in the format https://propelbildintegration.my.salesforce.com

  5. Click on setup integration

  6. Click on fetch categories. This will redirect you to salesforce. Login and click on allow if prompted. Click on fetch categories again.

  7. Enter the Thumbnail Field name you copied after creating the Thumbnail Field

  8. Chose what files you want to push to Propel

  9. Navigate to Integration settings

  10. Enable “Use Administrator to update files” and click on Save

Auth Token Generation in Bild

  1. Login from admin account and click on user profile pic in Bild.

  2. Click on tokens.

  3. Click on the Add button besides the Bild API

  4. 4. Enter token name(authToken) and click on No Expiry checkbox and click on create Button

  5. Copy the generated token value

Did this answer your question?