Ivan Arnaudov
Member
- Your Task History ID
- IjU3NjAwNTZhMDYzNjA0M2Q1MjY0NTUzNzUxMzI1MTYyNTQzNiI_3D_pc
I can't make way past a problem with the behavior of the Pabbly Connect JavaScript code module.
I need to pass a series of parameters to Crove to pre-fill a contract and send it for signature. Charanjit (Crove co-owner) confirmed to me there is an issue with the Pabbly integration which prevents it from passing properly formatted JSON, so I decided to compose the JSON semi-manually using the JavaScript code module.
The problem is that some of the fields may be empty during execution. A very simplified version that illustrates my problem:
This will perform under test (Save & Test during workflow design) even if the mapped variables for lines 2 and 3 are empty. The JSON will simply leave empty space, which is exactly what is required. However, when the workflow is executed automatically, the JS code module will produce the following output:
and although the workflow will continue afterwards, it will pass an empty JSON object which will of course fail to generate the contract in Crove due to missing data.
I tried to work around past that as a quick patchfix by attempting to pass my values through a Text Formatter -> Default value, with the idea that if the mapped data is empty, it will absorb that and simply return an empty string. But I can't do that because the Text Formatter -> Default value returns an error saying 'Empty Default Value'. Well, duh! What's wrong with wanting to have an EMPTY default value?!
So... as is apparent, I have several issues to solve. My whole approach is bad because I need to work with 12 sets of 5 data components, and for the life of me I can't figure out how to pass them through an iterator (so that I can have 5 iterators).
Bottom line: I need to know first and foremost why there is different behavior of the JS code module between manual execution (Save & Test in workflow design mode) and normal execution, when both operate on the same data set. If that is a bug that Pabbly can confirm and fix, it would be great. If not a bug, I will need help figuring out a way past that, short of ditching Pabbly completely for this project and writing my own PHP script to do that.
I have provided below links to the problematic workflow and task history. I hope what I wrote makes sense and that somebody will look into it, as it drives me crazy
Thanks in advance!
Ivan
I need to pass a series of parameters to Crove to pre-fill a contract and send it for signature. Charanjit (Crove co-owner) confirmed to me there is an issue with the Pabbly integration which prevents it from passing properly formatted JSON, so I decided to compose the JSON semi-manually using the JavaScript code module.
The problem is that some of the fields may be empty during execution. A very simplified version that illustrates my problem:
let data = {
"Course1" : "2. Line Items 0 Acf Fields Course Name Bul : Концептуално изкуство с Photoshop",
"Course2" : "2. Line Items 1 Acf Fields Course Name Bul : Концептуален дизайн на среда",
"Course3" : "2. Line Items 2 Acf Fields Course Name Bul : Концептуален дизайн на персонажи"
}
This will perform under test (Save & Test during workflow design) even if the mapped variables for lines 2 and 3 are empty. The JSON will simply leave empty space, which is exactly what is required. However, when the workflow is executed automatically, the JS code module will produce the following output:
SyntaxError: Unexpected identifier |
I tried to work around past that as a quick patchfix by attempting to pass my values through a Text Formatter -> Default value, with the idea that if the mapped data is empty, it will absorb that and simply return an empty string. But I can't do that because the Text Formatter -> Default value returns an error saying 'Empty Default Value'. Well, duh! What's wrong with wanting to have an EMPTY default value?!
So... as is apparent, I have several issues to solve. My whole approach is bad because I need to work with 12 sets of 5 data components, and for the life of me I can't figure out how to pass them through an iterator (so that I can have 5 iterators).
Bottom line: I need to know first and foremost why there is different behavior of the JS code module between manual execution (Save & Test in workflow design mode) and normal execution, when both operate on the same data set. If that is a bug that Pabbly can confirm and fix, it would be great. If not a bug, I will need help figuring out a way past that, short of ditching Pabbly completely for this project and writing my own PHP script to do that.
I have provided below links to the problematic workflow and task history. I hope what I wrote makes sense and that somebody will look into it, as it drives me crazy
Thanks in advance!
Ivan