Determine Submit Point ID from Multiple Points

Post Reply
Tenzo
Member
Posts: 22
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Determine Submit Point ID from Multiple Points

Post 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.
Attachments
MultipleSP.PNG
MultipleSP.PNG (23.24 KiB) Viewed 98298 times
loicaigon
Advanced member
Posts: 601
Joined: Wed Jul 10, 2013 10:22 am

Re: Determine Submit Point ID from Multiple Points

Post by loicaigon »

You could add a hidden field like "Submit Point ID" that you could later use in the flow?
Loïc Aigon
Enfocus PitStop Manager
jan_suhr
Advanced member
Posts: 684
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Determine Submit Point ID from Multiple Points

Post 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.
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
User avatar
JimmyHartington
Advanced member
Posts: 434
Joined: Tue Mar 22, 2011 7:38 am

Re: Determine Submit Point ID from Multiple Points

Post by JimmyHartington »

I will suggest the same idea as Loïc.

It would look like this when you configure the submit point:
Image
Tenzo
Member
Posts: 22
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Re: Determine Submit Point ID from Multiple Points

Post 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!
Tenzo
Member
Posts: 22
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Re: Determine Submit Point ID from Multiple Points

Post 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:
Image
This is the route I took. Thanks for confirming the idea. It pretty solid and is working great!
loicaigon
Advanced member
Posts: 601
Joined: Wed Jul 10, 2013 10:22 am

Re: Determine Submit Point ID from Multiple Points

Post by loicaigon »

Glad it helped.
Loïc Aigon
Enfocus PitStop Manager
Tenzo
Member
Posts: 22
Joined: Wed Jan 31, 2024 11:22 am
Location: USA :(
Contact:

Re: Determine Submit Point ID from Multiple Points

Post 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?
User avatar
tdeschampsBluewest
Member
Posts: 123
Joined: Tue Jun 01, 2021 11:57 am

Re: Determine Submit Point ID from Multiple Points

Post 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;
    }
}
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
Post Reply