Auto Set Custom Attribute

Automatically set the value of a custom attribute when a part is created.

Scenario

Every time a part is created, set the custom attribute Tracking Strategy based on the following table:

Tracking Level
Sourcing Strategy
Tracking Strategy

None

Make

N/A

None

Buy

N/A

Lot

Make

Lot - Make

Lot

Buy

Lot - Buy

Serial

Make

Serial - Make

Serial

Buy

Serial - Buy

Trigger

The flow should be triggered when a part is created.

Steps

  • Create a new flow using the ion-webhooks component. Configure the ion-webhooks step by setting the Connection, providing a name for the webhook receiver, and adding an action. In this example we want the flow to be triggered when a part is created so the action will be Parts - Create

  • Add a step that uses the First Resonance ION component. Click on the + icon at the bottom of the flow then search for First Resonance ION. Click on Run GraphQL Query.

Configure the Connection, GraphQL Query, and GraphQL Variables

Use the following query:

Use the following query variables:

Add a reference in the query variable to the incoming id from the webhook trigger

Refer to this for detailed documentation on using the First Resonance ION component.

  • Add a step that branches based on the value of the Tracking Level. Search for "branch" and select If Condition is Met

Configure the branch step to check the Tracking Level:

Click the icon in the first Field and configure the input to the output of the previous step.

Select does not exist for the Operator

  • Click on the + icon in the "Tracking is None" side of the branch. Search for "Execution save value". Select Execution - Save Value

Enter trackingStrategy for the Key and N/A for the Value

  • Click on the + icon in the "Else" side of the branch. Search for "Execution save value". Select Execution - Save Value

Enter trackingStrategy for the Key

Enter references to the trackingType and sourcingStrategy for the Value separated by a -

  • Add a step at the end of the flow that will return the value of trackingStrategy. Click on the + icon at the bottom of the flow then search for "Execution get value". Click on Execution - Get Value

Enter in trackingStrategy for the Key

  • Add a step to set a custom attribute to the value of trackingStrategy. Click on the + icon at the bottom of the flow then search for "First Resonance ION". Click on Run GraphQL Query.

Configure the Connection, GraphQL Query, and GraphQL Variables

Use the following query:

Use the following query variables:

Add a references in the query variable to the partId, etag, and value.

Reference to the partId:

Reference to the etag:

Reference to the value:

The query variables should look like this:

Refer to this for detailed documentation on using the First Resonance ION component.

The final flow should resemble this:

Last updated

Was this helpful?