Re: Filtering JSON Api Call Return

2018-03-10 Thread Andrea Casini
EDIT2: I managed to get around it by setting the filter in a variable as the following: - name: Set Fact Template ID set_fact: templateid: "{{ vdtemplates.json|json_query(templfilter)|join(', ') }}" vars: templfilter: "[?Caption=='template1'].Id" Still curious what other ways I

Filtering JSON Api Call Return

2018-03-10 Thread Andrea Casini
Hi, I'm trying to use the following JSON structure so that I can have a variable with "template1" or "template2" value and return the correspondant "Id" value. I tried using the map filter, json_query and others but I can't do what I need so I'm asking for help! Here's the JSON structure: [