Page 1 of 1

JS to look at PrivateData as a condition with variable or script expiression

Posted: Wed Apr 05, 2023 2:44 pm
by rhd_ole
Hi All -

I'm not sure why I'm struggling with this but I'm looking to create a script that will use the PrivateData of "size" that if true will move on to the next folder, and then use an 'all others' condition for any sizes that are false.

I am currently using 'Define condition with variables" but its cumbersome to manage all these sizes and I think it would be easier to place a script to do this since there are several flows that I manage that use this type of routing.

So for example all sizes that are : 6x9, 4.25x5.5, 10x13, would be true and move to the next folder, all other would go to a different folder to additional processing.

Re: JS to look at PrivateData as a condition with variable or script expiression

Posted: Wed Apr 05, 2023 4:17 pm
by jan_suhr
You can use the app Row2Variables. It will use an Excel or CSV file to get the value you need.
Tabel would look like this:
6X9 True
4.25X5.5 True
10X13 True
7X10 False

You can set it up to any value instead of True and in that way send it to different outgoing connections depending on the sizes youo have.

The result from the App will be a PrivateData tag that you use.

https://www.enfocus.com/en/appstore/pro ... 2variables

Re: JS to look at PrivateData as a condition with variable or script expiression

Posted: Wed Apr 05, 2023 4:33 pm
by rhd_ole
Great I'll take a look.

I will only know the sizes that would be true, any size not listed would need to go to a different folder. I will play around with it.

Re: JS to look at PrivateData as a condition with variable or script expiression

Posted: Thu Apr 06, 2023 4:02 pm
by rhd_ole
jan_suhr wrote: Wed Apr 05, 2023 4:17 pm You can use the app Row2Variables. It will use an Excel or CSV file to get the value you need.
Tabel would look like this:
6X9 True
4.25X5.5 True
10X13 True
7X10 False

You can set it up to any value instead of True and in that way send it to different outgoing connections depending on the sizes youo have.

The result from the App will be a PrivateData tag that you use.

https://www.enfocus.com/en/appstore/pro ... 2variables
I'm not getting this to work as I need. My issue is I only know the sizes I want, any not on the list I need to go to a different outgoing connection. They fail and do not give a PriveatData tag as a result.

I will continue to mess with this and try and get a script to work

Re: JS to look at PrivateData as a condition with variable or script expiression

Posted: Thu Apr 06, 2023 5:53 pm
by jan_suhr
In the Row2Variables you can set up the Warning outgoing connection to let missing values go that way.
That should solve the problem.
Check the documentation.