Expand my Community achievements bar.

SOLVED

Extract specific column from Data Store

Avatar

Level 9

Hello,

 

In the course of formulating this problem, I keep thinking that this should not be a challenge after all. Unfortunately, I've been trying around here for ages without success.

 

I do have a Data store containing multiple rows of contacs with multiple columns like name, category, email, ...

 

Now I want to fetch all email addresses of the people who have a specificcategory.

So I added a Data store module using the filter category = xy to get those contacts. Afterwards I want to just process the email addresses of those contacts to insert them into an array field in WF. But unfortunately I have no clue to do so.

 

I tried around with array aggregators, text aggregators and so on. Perhaps someone could help me to get back on the correct track.

 

Thanks in advance.

 

Regards

Lars

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Level 5

Wait, I re-read your message and think I now understand.  How about this?

Screen Shot 2023-09-18 at 3.03.57 PM.png

I'm attaching the blueprint for your reference/inspection.

View solution in original post

4 Replies

Avatar

Level 5

Hi Lars,

I'm trying to follow the actual ask, so apologies if I get something wrong.  I think you have a data store structured like this:

  • Email Address
  • Category

If the Category is a value of xy, then you want to process those values, such as aggregating them together.

So you'd want something like this:

Scenario SnippetScenario Snippet

Where the search on the data store is like this:

Data Store FilterData Store Filter

And the text aggregator is like this:

Text AggregatorText Aggregator

(You can obviously use a different text aggregator approach as needed!)

Does that answer your question?

CV

Avatar

Correct answer by
Level 5

Wait, I re-read your message and think I now understand.  How about this?

Screen Shot 2023-09-18 at 3.03.57 PM.png

I'm attaching the blueprint for your reference/inspection.

Avatar

Level 9

Hey CV,

 

Wow, thanks a lot for your effort! It is working as expected but at the moment I do not really understand why. 

I also worked with set / get variable when trying around on my own. But it did not work then. 

 

So in the upper string you are calling Get variable right behind the search operation on the Data store. I did not do that before, what led to the fact, that although there are multiple entries in the data store matching to my filter only the last one was saved to the array variable.

So my mistake was to reference the wrong state of of the array.

 

Thanks a lot for this solution!

 

Regards

Lars

Avatar

Level 5

Fusion’s programming model is one of “pass-by-value”, not directly “pass-by-reference”.  It also took me a bit to understand.

In effect, each “set” or “get” reference is a unique and immutable copy of the data involved.  So doing any kind of “increment” operation requires updating the variable reference before incrementing.  Then grab the final reference to use the final value.

This becomes one of those “patterns” you just memorize.   Good luck!