Pass through data from input form in Workflow to Javascript file | Community
Skip to main content
Level 2
Feb 23, 2023 10:04 AM UTC
Solved

Pass through data from input form in Workflow to Javascript file

Hello! Im currently building a custom activity in my extension workflow. But where Im stuck right now is where I need to pass on the values that has been put in on the custom activity node to the javascript. 

 

Use-case: We need a new Activity node where users can add title, text, start- and end-date, and some other information that we want to send via an API to an endpoint. These values will then be displayed on the customers private page.

 

The activity that I have created:

Input form:

Extension of the workflow schema:

And then I have a javascript value that will send the values from the input-form to the API, but currently Im using dummy-data, as Im not able to get the values from the workflow.

 

So that is what I need help figuring out. When a user starts a workflow and runs the custom activity, I want that specific data to pass on to the javascript file. Lets call it abc:javascriptfile.js.

 

Hope someone know how to help!

 

Best Regards,

Martin

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
_Manoj_Kumar_
_Manoj_Kumar_Accepted solution
New Participant
Feb 27, 2023 11:20 AM UTC

Hi, that didn't work. Not definition of activity.


Hello @marting66652718 

 

Try this.params.activity.title

     Manoj     Find me on LinkedIn

6 replies

_Manoj_Kumar_
New Participant
Feb 23, 2023 10:14 PM UTC

Hello @marting66652718 

 

Within the element tag of the custom activity in a workflow, schema add this code to call your js file

<attribute default="abc:javascriptfile.js" name="library">

 

Translate
     Manoj     Find me on LinkedIn
Level 2
Feb 24, 2023 12:20 PM UTC

Hi! 

 

I already have that in the schema:

<attribute default="'lf:communicationService.js'" name="library" type="string"/>

 

But not sure on how to use the data from the activity in the javascript-file called lf:communicationService.js.

Translate
_Manoj_Kumar_
New Participant
Feb 26, 2023 2:15 AM UTC

Hello @marting66652718 

 

You should be able to get the attributes in your _call function with 

activity.@title activity.@textField
Translate
     Manoj     Find me on LinkedIn