Hello all,
First of all, I want to thank Steinar of making and maintenance this great software! I am quite new and just testing it, but it is really great work!
Back to subject - I trying to work with HTTP communicate processor. It allows populate single variable (BTW. not the first one on list of user variables, it seems like little bug ), but I stucked on problem how to receive/decode (eg. from JSON response) more than 1 value.
For example: if response from another application through JSON will return:
{ 'val1' : 'first value content', 'val2' : 'second value content' }
I did not find any function in Populate Variables processor which can help me with that (besides using substring functions on static indexes) but it is of course impossible to predict length of first value etc.
Maybe someone already know solution and I just missed something really obvious in documentation?
Regards,
Artur
Populating more variables through HTTP communication processor
Re: Populating more variables through HTTP communication processor
Hi artmit,
great stuff, i like that you seem to have no big issues using ffastrans!
I can confirm there seems to be a bug using "the first uservariable" in the HTTP Communicate processor - Dropdown to select the user variable to polulate. The first user var in the list just don't seem to Show up, or better Shows up with an emtpy Name. @steinar will be interested in that one...
Second, can you live with a simple between function? .. e.g. if my json Looks like that:
In a populate variables processor, i could use like that to get the first occurence of the value value "value_to_parse"
Note that doublequotes are escaped with another doublequote instead of the typical backslash...
To define it a Little better, your workflow Looks like this:
HTTP Call (populate result to variable) -> Populate Variables (parse and populate all the values you like into different user variables)
cheers,
emcodem
great stuff, i like that you seem to have no big issues using ffastrans!
I can confirm there seems to be a bug using "the first uservariable" in the HTTP Communicate processor - Dropdown to select the user variable to polulate. The first user var in the list just don't seem to Show up, or better Shows up with an emtpy Name. @steinar will be interested in that one...
Second, can you live with a simple between function? .. e.g. if my json Looks like that:
Code: Select all
{"something":"notinterestingvalue","Connection":"value_to_parse","somethingelse":"notinterestingvalue"}
Code: Select all
$between("%s_restcontent2%", "Connection"":""", """,",1)
To define it a Little better, your workflow Looks like this:
HTTP Call (populate result to variable) -> Populate Variables (parse and populate all the values you like into different user variables)
cheers,
emcodem
emcodem, wrapping since 2009 you got the rhyme?
Re: Populating more variables through HTTP communication processor
Hi emcodem,
I've just put some specially-designed unused variable there as first in list, to fill the gap
Good tip, thanks! Of course I also thought now that this way I can setup some more Populate Variables processors to get next values!
Thanks!
Artur
I've just put some specially-designed unused variable there as first in list, to fill the gap
Good tip, thanks! Of course I also thought now that this way I can setup some more Populate Variables processors to get next values!
Thanks!
Artur
Re: Populating more variables through HTTP communication processor
Not sure if you got that so just to be sure: a single populate variables processor allows you to define and parse 7 different values from your JSON. How many values do you need to parse?
cheers!
emcodem
emcodem, wrapping since 2009 you got the rhyme?
Re: Populating more variables through HTTP communication processor
Ok I forgot that there are more fields to be filled in
Thanks!
Artur
Thanks!
Artur
Re: Populating more variables through HTTP communication processor
Hi Artur, thank you for using FFAStrans and welcome to the forum!
In your case you might want to use single quotes when encapsulating text containting double quotes. It's easier to deal with.
$between("%s_get_day%", 'Connection":"', '","',1)
Also, thanks for reporting the variable issue. I will investigate.
-steinar
In your case you might want to use single quotes when encapsulating text containting double quotes. It's easier to deal with.
$between("%s_get_day%", 'Connection":"', '","',1)
Also, thanks for reporting the variable issue. I will investigate.
-steinar
Re: Populating more variables through HTTP communication processor
Yes, much easier! At least, it work only if use single-quotes on inputs string parameter - as inside there are double quotes already included.
Many thanks for help!
Artur
Many thanks for help!
Artur
Re: Populating more variables through HTTP communication processor
Ok, I eventually found proper function for it:
Thought there has to be something
Code: Select all
$readarray()