Page 1 of 1
Determine Submit Point ID from Multiple Points
Posted: Wed Apr 23, 2025 5:16 pm
by Tenzo
Hey all,
I am not sure if this is the way to go about it or if there is a better alternative.
I have three different Submit points that go to 1 flow, each with their own properties and purpose.
When the Job arrives at "Order_Export" How can I determine which Submit point the job is coming from? Maybe there is another approach to this situation that I am not aware of that would be more of a standard practice? I was thinking of making only one submit point with a lot of conditions to make the Submit point more dynamic and handle all 3 roles but that seems like a more complex workaround. Any guidance or input on this would be greatly appreciated.
Re: Determine Submit Point ID from Multiple Points
Posted: Wed Apr 23, 2025 5:28 pm
by loicaigon
You could add a hidden field like "Submit Point ID" that you could later use in the flow?
Re: Determine Submit Point ID from Multiple Points
Posted: Wed Apr 23, 2025 5:41 pm
by jan_suhr
Can't you use the Dataset name?
You could also add a folder after the Submit point where you add a Private data to the job identifying the Submit point.
Re: Determine Submit Point ID from Multiple Points
Posted: Thu Apr 24, 2025 7:40 am
by JimmyHartington
I will suggest the same idea as Loïc.
It would look like this when you configure the submit point:

Re: Determine Submit Point ID from Multiple Points
Posted: Thu Apr 24, 2025 3:28 pm
by Tenzo
loicaigon wrote: ↑Wed Apr 23, 2025 5:28 pm
You could add a hidden field like "Submit Point ID" that you could later use in the flow?
This is a good Idea. What I have decided to do is they all have the same "Submitted_Data" Dataset, and each one has their own SubmitPointID. So now in my script I can always get the SubmitPointID and get ID specific values to use in my flowcontrol! Thanks again for the suggestion, it really helped alot!
Re: Determine Submit Point ID from Multiple Points
Posted: Thu Apr 24, 2025 3:29 pm
by Tenzo
JimmyHartington wrote: ↑Thu Apr 24, 2025 7:40 am
I will suggest the same idea as Loïc.
It would look like this when you configure the submit point:
This is the route I took. Thanks for confirming the idea. It pretty solid and is working great!
Re: Determine Submit Point ID from Multiple Points
Posted: Thu Apr 24, 2025 4:34 pm
by loicaigon
Glad it helped.
Re: Determine Submit Point ID from Multiple Points
Posted: Thu May 01, 2025 4:29 pm
by Tenzo
loicaigon wrote: ↑Thu Apr 24, 2025 4:34 pm
Glad it helped.
Sorry, I am back again.
In my Typescript, is there a way to gather all metadata at once?
Right now, I am getting each one individually like:
Code: Select all
const Batch_List = ( await job.getVariableAsString (`${DataSetPath} 'Batch #']/value"]`)as string).split(",")
const Selected_Date = await job.getVariableAsString (`${DataSetPath} 'Date']/value"]`) as Date
const FilterBatch = await job.getVariableAsString (`${DataSetPath} 'Filter Batch']/value"]`)as string
const filtercatagory = await job.getVariableAsString (`${DataSetPath} 'Filter Product Catagory']/value"]`)as string
const Catagory = await job.getVariableAsString (`${DataSetPath} 'Product Catagories']/value"]`)as string
const filterGroup = await job.getVariableAsString (`${DataSetPath} 'Filter Product Group']/value"]`)as string
const Group = await job.getVariableAsString (`${DataSetPath} 'Product Groups']/value"]`)as string
I was hoping I could get it all as one object. Is this possible or is there a better way to get all of the fields?
Re: Determine Submit Point ID from Multiple Points
Posted: Fri May 02, 2025 12:10 pm
by tdeschampsBluewest
Hi Tenzo,
To achieve this, you’ll need to use the XML Document class. You can find the documentation here:
https://www.enfocus.com/manuals/Develop ... thods.html
Alternatively, another approach would be to parse your XML as JSON, which could be more convenient when working with JavaScript (though you would lose the XPath functionality in this case).
Here’s a simple example using xml2js to convert your XML to JSON:
Code: Select all
import fs from 'fs';
import xml2js from 'xml2js';
async function getDatasetAsJson(job: Job, dataset: string): Promise<object> {
const datasetPath = await job.getDataset(dataset, AccessLevel.ReadOnly);
const xmlData = fs.readFileSync(xmlFilePath, 'utf8');
try {
const parser = new xml2js.Parser({ explicitArray: false });
const jsonData = await parser.parseStringPromise(xmlData);
return jsonData;
} catch (error) {
throw error;
}
}