โ12-05-2019 01:24 AM
Iโm getting data out of a REST call and I need to check whether or not a certain entry is present or missing. My list of needed entries consists of, example: String1, String2, String3, String4. If only the the first three are present, how do I print out that String4 is missing in my entries and how do i filter duplicates, for example String1 = String2 (I need to print the name of the duplicate)? I have tried using the Conditional snap, but havenโt had any success so far. Any suggestions? Thank you.
โ12-05-2019 01:26 AM
could you please share the JSON of the rest output
โ12-05-2019 02:01 AM
[
{
โallโ: โError|Dimension|Error|Dimension|Error|Deals|Error|Re|Error|Rem|Error|Supplier|Error|ranchesโ
}
]
this is the JSON after mapping and aggregate, now I need to separate the Dimension and count it, and how do I print that โShoppingโ is missing in the โallโ
โ12-05-2019 02:10 AM
Hereโs a sample JSON similar to the one Iโm working with. I want to check with each execution whether or not for example if โlabelโ contains Pipeline_2 or not. After that, I want to print out a message that โPipeline_2โ is missing.
[
{
โstatusLineโ:{
โprotoVersionโ:โHTTP/1.1โ,
โstatusCodeโ:200,
โreasonPhraseโ:โOKโ
},
โentityโ:{
โresponse_mapโ:{
โentriesโ:[
{
โpipe_idโ:โ111โ,
โhas_lintsโ:false,
โdocumentsโ:0,
โccidโ:โ121โ,
โchild_has_lintsโ:false,
โparent_ruuidโ:โ122โ,
โsubpipesโ:{
},
"state_timestamp":"2010-10-10",
"error_documents":0,
"label":"Pipeline_1",
"state":"Completed",
"create_time":"2010-10-10",
"invoker":"error_handler",
"duration":1067,
"id":"125",
"mode":"standard"
},
{
"pipe_id":"222",
"has_lints":false,
"documents":3767064,
"child_has_lints":false,
"parent_ruuid":null,
"subpipes":{
},
"state_timestamp":"2010-12-12",
"error_documents":0,
"label":"Pipeline_2",
"state":"Completed",
"create_time":"2010-12-12",
"invoker":"triggered",
"duration":1074,
"id":"212",
"mode":"standard"
}
โฆ
]
โ12-06-2019 02:45 AM
Hello @alstef
Regarding the check whether or not, โlabelโ contains Pipeline_2 , one way of doing that is by ternary operator in the mapper snap. For the above mentioned example that you pointed out, the solution would be $label.contains( โPipeline_2โ) ? $label : โPipeline_2 is missingโ or if you want strict check on the name of the string, than you can do $label == โPipeline_2โ ? $label : โPipeline_2 is missingโ
Regards
Dimche