Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Storing distinct field values as JS variables without knowing the data content

Avatar

Avatar
Level 1
Aclypse10
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
Aclypse10
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
Aclypse10
Level 1

12-11-2020

Hi guys,

 

I'm trying to create a Split activity based on distinct values of fielddata. I'm trying to fetch city centre data from regions. I tried this in JS:

 

var query = xtk.queryDef.create(
<queryDef schema="temp:enrich3" operation="select" distinct="true">
<select>
<node expr="city"/>
</select>
</queryDef>);
var resultSet = query.ExecuteQuery();
for each (var row in resultSet)
{​​​​​
vars.city = row.city;
logInfo(vars.city);
}​​​​​

 

This will return the following:

 

12/11/2020 09:57:21 PIJNACKER
12/11/2020 09:57:21 BLEISWIJK
12/11/2020 09:57:21 BERGSCHENHOEK
12/11/2020 09:57:21 ROTTERDAM
12/11/2020 09:57:21 DELFGAUW
12/11/2020 09:57:21 Pijnacker-Nootdorp
12/11/2020 09:57:21 BERKEL EN RODENRIJS
12/11/2020 09:57:21 NOOTDORP
12/11/2020 09:57:21 DELFT


I want each and every one of these values to be stored seperately with some kind of linenumber/rownumber so I can select them in a Split activity by saying something like vars.city1 is not empty and so on.

 

How can I do this?

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

924 likes

Total Posts

1,054 posts

Correct Reply

494 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

924 likes

Total Posts

1,054 posts

Correct Reply

494 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

17-11-2020

Hi,

 

You'd need to use initialization script of split (or cells?) activity to dynamically alter the activity's transitions.

What is the goal of splitting on city?

 

Thanks,

-Jon