cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Fetching query from configuration file

rashmi
New Contributor III

Hi All,
I wanted to write query with value from inputstream but fetch the query from the configuration file/ json file which is stored in sldb instead of writing query directly in the snap
for example if consider this statement i am using inside the snap
image

it should evaluate to this query
SELECT * FROM app_0046_customervoice.rcur_bfo_ACCOUNT WHERE SEACCOUNTID__C IN (โ€˜0001088191โ€™,โ€˜0021088450โ€™));
do i have to escape any character as i am getting syntax error when i am am using it in expression/configuration file
input:
[
{
โ€œSE_ACCOUNT_IDsโ€: โ€œ0001088191โ€™,'0021088450โ€
}
]
image
image

Any help is appreciated!

3 REPLIES 3

pmancevski
New Contributor III

Hi @rashmi,

Try to build to build snaplogic expression with double quotes. I think this will do the trick.

But if you want to have something like configuration file then please/check the following logic:

testQuery.expr (133 Bytes)
in .expr file there is already prebuild expression and is expecting one parameter.

I tested with mapper and this is the following output:

image

image

More information on the following link:
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438110/Expression+Libraries

Thanks,
Pero M.

jcornelius
New Contributor III

@rashmi Yuo could simply read in the config file, parse it, and format the data with a mapper, then send that as your Query string

image

rashmi
New Contributor III

@pmancevski, @jcornelius Thanks a lot!