Values taken from Search Data Store Are Not Converted to Module Values

Hi,

I’m trying to process data from a module that outputs several bundles, get the corresponding data associated with the input, and combine them into a single array output.

The problem is, the values from the input bundles are stored in different/dynamic collection (see screenshot for reference).

To solve this, I created a Data Store that contains the input value and the intended output value, and used the Search Data Store to give the output. Think of it as a switch module.

However, when combining all the output into a single array, the output values are presented as text instead of giving out the actual data it represents.


Is there a way to convert this text into actual data?

Thanks,

Anthony.

Looks like your “text” is in JSON.

To convert JSON into a collection, use the Parse JSON module first.

This has to be done before the array aggregator.

1 Like

Hi Sam,

Thanks for the pointer.

I’ve done what you suggest but it seems I encounter an error. Perhaps this has something to do with my data structure.

How do you suggest I modify the modules?

Thanks,

Anthony.

Oh your JSON is not even JSON.

The issue is wherever it is adding new Data Store entries, not in the “reading” of the entries.

2 Likes

Yess, the JSON in question is not a real JSON taken from the modules. Instead, it is a text data that looks like the JSON in plain text created as my workaround to process the data. You can say it is a synthetic JSON.

Is there a solution to use this synthetic JSON at all?

If not, do you have any ideas on how to correctly identify which collection from the input bundle is not empty, takes the data, then process the inputs?

There is no data associated with whatever you stored, so you can’t use it.

{{7.heading... }} is a Make mapping associated with a variable, but it appears this syntax was stored instead of the variable’s value.

It does not contain the plain_text variable at all.

This is like I sold you a car. But actually I just gave you a piece of paper with the word “car” written on it. You did not receive the car.

To fix this you need to address how it was stored in the first place, in another scenario perhaps.

2 Likes

Alright, thanks for clarifying that this approach can’t directly work.

Basically Make doesn’t read the synthetic JSON as a real JSON with real value, thus Make only passes the synthetic JSON as just a text.

To confirm your suggestion, I should think of a way to call the real JSON’s value. Perhaps this scenario should focus on creating records on a Data Store and triggering a second scenario, which will then output the value.

Am I in the right direction?

Yes, a database like Data Store is a valid way of passing variables between scenarios.

Variables are destroyed (erased from memory) after a scenario completes, so it doesn’t make sense to reference a variable from another scenario.

You can store the data in a more permanent way using the Data Store, and then fetch it at a later time.

2 Likes