Skip to main content
Solved

Workflow Validation using Custom Event - What Variables are Available


Forum|alt.badge.img+11

Hi Community, 

This may be a simple question, but I cannot find description anywhere. 

I have created a Workflow, that is run from a Custom Event, that is triggered from the New record in the Inventory Transaction History table. The Workflow executes, but as soon as it trys to use the values from the custom event in an API Read Call, it errors. 

I dont understand how to map the fields in the custom event, i.e. source_ref1, source_ref2, which are NEW:Source_ref1, NEW:Source_ref2 in the event to the Parameters in an API call. 

When the workflow runs, i get an error indicating that ${SourceRef1} is unknown. 

Is there anywhere that explains the mapping between the fields that are made available in the Custom Event, and what the syntax needs to be when passing these values to the API call, or do you need to intercept them in the workflow with some javascript to set the variables to make them available?

 

Thanks,

Best answer by kvbe

@david.harmer  This is a very common issue and makes that the workflows are sometimes very hard to debug and start with. 

 

A couple approaches to debug:

  • As a custom_event is more into the SQL world it “could be” that the variable is source_ref1
  • Just remove everything from your workflow and just do a start and end event 
    • This will make that you do not trigger any error and the workflow will just trigger and exit 
    • With the observations you can then see what actually comes in

If this does not work, maybe post your setup with some screenshots and we can help a bit further

 
 
View original

Forum|alt.badge.img+10
  • Hero (Partner)
  • June 12, 2024

@david.harmer  This is a very common issue and makes that the workflows are sometimes very hard to debug and start with. 

 

A couple approaches to debug:

  • As a custom_event is more into the SQL world it “could be” that the variable is source_ref1
  • Just remove everything from your workflow and just do a start and end event 
    • This will make that you do not trigger any error and the workflow will just trigger and exit 
    • With the observations you can then see what actually comes in

If this does not work, maybe post your setup with some screenshots and we can help a bit further

 
 

Forum|alt.badge.img+11

@kvbe Thanks for the email, I had tried to enable the Watch, but never managed to get any observations, however following the guide in the link, and creating a simple “Observations” workflow, it worked as expected. 

I think having that sort of workflow created to enable the capture of the available variables, and their naming syntax is so helpful, so hopefully this post helps someone else. 

Thanks. 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings