JSON

748

Solutions

746

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi,

I would like to get help with converting from vb.net to json. I need to have classes and conversion to be in this format once it's been serialized:
{
  "Employee": {
    "EmployeeId": "9978",
    "PersonalIdentityNumber": "19730222-9989",
    "FirstName": "Karin",
    "LastName": "Brovall",
    "FullName": "Karin Brovall",
    "Address1": "",
    "Address2": "Båtsmansvägen 7",
    "PostCode": "441 50",
    "City": "ALINGSÅS",
    "Country": "",
    "Phone1": "0322-36844",
    "Phone2": "",
    "Email": "",
    "EmploymentDate": "1997-10-01",
    "EmploymentForm": "TV",
    "SalaryForm": "TIM",
    "JobTitle": "Försäljning",
    "PersonelType": "ARB",
    "ScheduleId": "HEL",
    "ForaType": "-",
    "MonthlySalary": 0,
    "HourlyPay": 125,
    "TaxAllowance": "TMP",
    "TaxTable": 34,
    "TaxColumn": 1,
    "NonRecurringTax": 30,
    "Inactive": false,
    "ClearingNo": "", 
    "BankAccountNo": ""
  }
}

Open in new window


For this reason I used json utils to convert to classes and got this result:
    Public Class Employee
        Public Property EmployeeId As String
        Public Property PersonalIdentityNumber As String
        Public Property FirstName As String
        Public Property LastName As String
        Public Property FullName As String
        Public Property Address1 As String
        Public Property Address2 As String
        Public Property PostCode As String
        Public Property City As String
        Public Property Country As String
   

Open in new window

0
Cloud Class® Course: Certified Penetration Testing
LVL 12
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

i have a json file, which contains KV pairs like below.

{
"app1_ds1_ds_jndi": "value1",
"app1_ds1_ds_url": "value2",
"app1_ds1_ds_useri": "value3",
"app1_ds1_ds_pwd": "value4",


"app1_ds2_ds_jndi": "value5",
"app1_ds2_ds_url": "value6",
"app1_ds2_ds_user": "value7",
"app1_ds2_ds_pwd": "value8",


"app2_ds1_ds_jndi": "value9",
"app2_ds1_ds_url": "value10",
"app2_ds1_ds_user": "value11",
"app2_ds1_ds_pwd": "value12",

}


I want to parse the above file to grep for all app1 datasources, ignoring other apps like app2, app3 ..etc., and construct an array of hashes in ruby like below.




[{jndiname: "value1",  url_name:"value2" user_name: "value3", Password:"value4"},
{jndiname: "value5",  url_name:"value6" user_name: "value7", Password:"value8"}
]
0
Total noob here, trying to ramp up knowledge to replace somebody at work who's leaving... In a Symfony 2 controller I am trying to add a public function (a SQL query) from the DB.php file. It will output to a JSON response. The IDE shows an error, which I'm sure is because I don't have all the needed info in there. What else do I need? Please see attached pic.
2018-08-11_15-04-11.jpg
0
I have the following json:
{
"count":2,
"page":1,
"pageSize":2,
"students":[{"forename":"Joe","surname":"Bloggs"},{"forename":"John","surname":"Doe"}],
"totalCount":2,
"totalPages":1
}

Open in new window


How can I alter this in PHP to just get the following:
{
[{"forename":"Joe","surname":"Bloggs"},{"forename":"John","surname":"Doe"}]
}

Open in new window


Thank you in advance
0
Dear sirs,
Please help, how can I avoid this exception. It happens when my http response includes an empty List in the body.

org.springframework.web.client.RestClientException: Error while extracting response for type [java.util.List<?>] and content type [application/json;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token; nested exception is com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token at [Source: (PushbackInputStream); line: 1, column: 1] at org.springframework.web.client.HttpMessageConverterExtractor.extractData(HttpMessageConverterExtractor.java:115) at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:991) at org.springframework.web.client.RestTemplate$ResponseEntityResponseExtractor.extractData(RestTemplate.java:974) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:725) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:698) at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:649) at com.finger.services.AppRestTemplateService.doHandleListRequest(AppRestTemplateService.java:140) at

Please, assist
0
This question will likely expose my level of understanding of JQuery but I am getting this error:

Uncaught TypeError: $(...).marquee is not a function
    at results_scrollx.asp?event_type=5&event_id=794&race_id=1382:62

On this page: https://www.gopherstateevents.com/results/fitness_events/results_scrollx.asp?event_type=5&event_id=794&race_id=1382

I assume there is something structurally wrong but I haven't found it yet...  Any help would be much appreciated.
0
Trying to get the values of Json Array isnt working.

for(var i = 0; i < testjson.TYPE_ID.length; i++){
            if(testjson.TYPE_ID[i]) {count += 1;}
        }

Open in new window


"TYPE_ID":["pinterest","vimeo","gravatar","twitter","linkedin","klout","facebook","flickr","foursquare"] . this is the Json here which im trying to pull all these arrays and check for one of them to output a response.

using JQ, JS
0
I am trying to make a request to Google Cloud NLP API to obtain sentiment analysis for a piece of text. I used Postman to design the correct request, and I was able to get a valid response using Postman. However, when I try to make the same request from Swift, it gives me an error. The error and code snippet used to make the request is shown below.

func sendAPIRequest(with text: String){

    print("Text: ", text)
    let jsonRequest = [
        [
        "document":[
            "type":"PLAIN_TEXT",
            "language": "EN",
            "content":"'Lawrence of Arabia' is a highly rated film biography about British Lieutenant T. E. Lawrence. Peter O'Toole plays Lawrence in the film."
        ],
        "encodingType":"UTF8"
    ]
        ]

    let jsonObject = JSON(jsonRequest)


    let headers: HTTPHeaders = [
        "X-Ios-Bundle-Identifier": "\(Bundle.main.bundleIdentifier ?? "") ",
        "Content-Type": "application/json"
    ]
    let APIRequest = Alamofire.request("https://language.googleapis.com/v1/documents:analyzeSentiment?key=\(gCloudAPIKey)", method: .post , parameters: jsonRequest as? [String: Any], encoding: JSONEncoding.default , headers: headers).responseJSON { (response) in
        print(response)
        if let json = response.result.value {
            print("JSON: \(json)")
        }
    }

Open in new window


Error:
JSON: {
error =     {
    code = 400;
    details =         (
                    {
            "@type" = "type.googleapis.com/google.rpc.BadRequest";
            fieldViolations =                 (
                                    {
                    description = "Must have some text content to annotate.";
                    field = "document.content";
                }
            );
        }
    );
    message = "One of content, or gcs_content_uri must be set.";
    status = "INVALID_ARGUMENT";
};
}

Open in new window

0
I've been successfully experimenting with interfacing with WordPress's REST API using React.  I've enabled CORS for the remote WordPress site (by modifying it's .htaccess file), and I've succeeded at consuming the JSON data from the API and displaying it by rendering it in my App.js file.  

The code for my App.js file is as follows:

import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';

import { 
  BrowserRouter,
  Switch, 
  Route
} from 'react-router-dom';

import Home from './components/Home';
import Accounts from './components/Accounts';

class App extends Component {

  constructor() {
    super();
    this.state = {
      accounts: []
    }
  }

componentDidMount() {
  let accountsURL = 'https://mywordpresssite.com/wp-json/wp/v2/posts';
  fetch(accountsURL)
  .then(response => response.json())
  .then(response => {
    this.setState({
      accounts: response
    })
  })
}

  render() {

    let accounts = this.state.accounts.map((account, index) => {

    return (    
        <div key={index}>
          <p>{account.title.rendered}</p>
          <hr/>
        </div>   
      )
    });      

    return (
      <div className="App">

        <header className="App-header">
          <br />
          <img src={logo} className="App-logo" alt="logo" />
        </header>

        <br />     

        {accounts}

        <div className="row">
          <BrowserRouter>
            <Switch>
              <Route path="/" exact 

Open in new window

0
I know similar questions to this have been asked before but I'm having difficulty implementing the solutions.  I have a very simple access database which uses an API to get outside data.  I am getting the correct data now, but the response is JSON that I need to parse into a table and/or update rates in an existing table.  Essentially I am trying to do the same thing as in this question:

https://www.experts-exchange.com/questions/28952370/Parse-JSON-with-VBA-Access-2010.html

I have no idea how to implement this though.  I am a complete novice at JSON and using an API.  Can anyone give me some pointers in laymans terms on how to implement this?  I need to know what code to put into a module, and how to call it.  Once I see it working Ill be able to run with it I think, but right now Im very confused.
0
Cloud Class® Course: Amazon Web Services - Basic
LVL 12
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Hi there,

Can anyone help me for below query.
How to hit POST API through TDL language which can send data in JSON format from Tally and get response.  Please send us complete code for this.

      
I am using below code but this is not working.

[#Menu: Gateway of tally]
      Add: Item: send data : Call: Senddata
      
[Function: Senddata]
            
      00      :      Walk            : SendDatacoll      
      10      :      End Walk
      20      :      Return
      
[Collection      : senddatacoll]
      Remote URL            : "API url"
      RemoteRequest        : RepsalesVch       : UTF8
      ClientOnly             : Yes
      KeepSource      : yes
      JSON Object            : yes
      
      
      
[Report      : RepsalesVch]
      Form: RepsalesVch
      
[Form :      RepsalesVch]
      Part      : RepsalesVch Body
      Button      : Export button
      JSONTag      : "Report"
 
                        
[Part: RepsalesVch Body]
      JSONTag            : "Body"
      Line            :  RepsalesVchdetails
      
[Line:      RepsalesVchdetails ]
            Field            : ParCDBId, Partnername  , ActiveStatus  
            JSONTag            : "Details"


[Field:      ParCDBId ]
      Set as             :   "NDL002"
      JSONTag       :       "ID"
      
      
[Field                  :      Partnername ]
      Set as             :       "ABC PVT LTD"
      JSONTag            :      "ITEMNAME"
      
      
[Field                  :      ActiveStatus ]
      Set as             :       "1"
      JSONTag            :      "Active"
      

Regards
Pushpa Adhikari
0
I have a json file attached, I need java code to read it and extract to several json files 1 per json record. This has to be in JAVA. I have attached the file. It has test data.\
So in the example I need 3 json files.

example:
[{"PositionID":"1","Filter":"Non TB - ML C&S","CloseofBusiness":"May 21 2018","Source":"Janus"},{"PositionID":"2","Filter":"Yes TB - BOA","CloseofBusiness":"July 31 2018","Source":"Fidelity "},{"PositionID":"3","Filter":"Non TB - VANGUARD INDEX 500","CloseofBusiness":"Jun 31 2018","Source":"Vanguard "}]

There are 3 json records I need 3 json files from this 1 json  entry. So I need code for this fast.
simulated_json.txt
simulated_json.txt
0
I have created a LINQ to return data from SQL server in JSON format which contains nested values.
Attach the code and output, the JSON is showing duplicate values for FieldID:6

var query =  from g in entity.ConfigSearchFieldGroupings
                         join f in entity.ConfigSearchFieldGroupingFields
                         on g.GroupingID equals f.GroupingID
                         join d in entity.ConfigDataFields
                         on f.FieldID equals d.FieldID
                         join ss in entity.ConfigSelections
                         on d.FieldID equals ss.FieldID into t
                         from rt in t.DefaultIfEmpty()
                         join s in entity.ConfigSourceSystems
                         on d.SystemCode equals s.SystemCode
                         where g.IsActive == true
                         && d.IsActive == true
                         && s.IsActive == true
                         && g.GroupingID == siGroupingID
                         && d.IsSearchable == true
                         select new
                         {
                             g.GroupingName,
                             f.FieldID,
                             d.FieldName,
                             d.FieldText,
                             d.FieldDescription,
                             d.FieldCategory,
                             d.FieldDataType,
                             d.FieldLength,
                             

Open in new window

0
This is about Amazon AWS. We used AWS S3 for static web page, and also cloudfront for SSL cert and other functions. Recently, our web auditor told us that our website failed few of the web security headers. These headers include, x-xss-protection, x-frame-options, x-content-options, strict-transport-security, and so on.

We heard that we can use AWS's lambda (or lambda@edge) to "change" the security headers. We also found this URL from AWS. Please see the link > https://aws.amazon.com/blogs/networking-and-content-delivery/adding-http-security-headers-using-lambdaedge-and-amazon-cloudfront/. We followed the steps, we are using the "Author from scratch" to build the lambda function, update the json code, publish a new version, and finally include the "trigger" for the cloudfront.

After that, wait about 20 minutes for the cloudfront to be deployed again. Browsing the web site as per normal, but, however, if we test our website in https://observatory.mozilla.org, we got "F" with those problemed security headers still failed.

What could be the problem? How can we troubleshoot from here?

Thanks in advance
0
I'm using json2.asp from:  https://github.com/nagaozen/asp-xtreme-evolution.

Here is a sample string:
[
{"Product Line":"B5","Model":"B521432CSSK","length":"14","Column1":"14'x5" Channel Buggy Hauler","Dealer Cost":"$2,685.00"},
{"Product Line":"B5","Model":"B521632CSSK","length":"16","Column1":"16'x5" Channel Buggy Hauler","Dealer Cost":"$2,684.00"},
{"Product Line":"B5","Model":"B521832CSSK","length":"18","Column1":"18'x5" Channel Buggy Hauler","Dealer Cost":"$2,719.00"}
]

When I run the following:
dim info : set info = JSON.parse(join(array(ProductFeed)))
for each key in info.keys()
Response.write key
next
set info = nothing

I get numbers. If I remove the brackets at the beginning/end of the string, I get "Product Line", "Model", etc. - but I only get the first row of the string.

I need to loop through the whole JSON string, get the name and value pair, process, go to the next row....

Any help would be appreciated.
0
getting api data from posts from another sources to django
hello guys ,

is there any way where

when users can add the link of the post they want to save and the django should add that post allong with description and image to database

eg:

https://www.reddit.com/r/memes/comments/91jdgp/everything_goes_back_to_spongebob/

if i want to save this post

then dango should get data from this post as a json format and should save this post image, description ,title and all to the database

i know this can only be done using api/praw

but cant understand how to make it happen

any kind of help is appreciated
0
Hello,
Im trying to translate this code from https://securionpay.com/docs/api#checkout-request-sign.
EXAMPLE SIGNING


export checkout_request='{"charge":{"amount":499,"currency":"EUR"}}'
export signature=`echo -n "$checkout_request" | openssl dgst -sha256 -hmac 'pr_test_tXHm9qV9qV9bjIRHcQr9PLPa' | sed 's/^.* //'`
echo -n "$signature|$checkout_request" | base64
        

EXAMPLE SIGNED CHECKOUT REQUEST


Y2Y5Y2UyZDgzMzFjNTMxZjgzODlhNjE2YTE4Zjk1NzhjMTM0Yjc4NGRhYjVjYjdlNGI1OTY0ZTc3OTBmMTczY3x7ImNoYXJnZSI6eyJhbW91bnQiOjQ5OSwiY3VycmVuY3kiOiJFVVIifX0=
				

Open in new window


to Ruby on Rails

I ended with

       
 checkout_request='{"charge":{"amount":5,"currency":"EUR","capture":true}}'
 secret_key = 'sk_test'
 @signature = Base64.urlsafe_encode64(OpenSSL::HMAC.hexdigest('sha256', checkout_request, secret_key) + "|" + checkout_request)

Open in new window


which isn't valid and its not exacly translation of the script.

When i test shell version with my secret key it works.
I tried Base64.urlsafe_encode64, encode64, strict_encode65, I tried digest instead of hexdigest. All kinds of way because I desperatly can't make it work. I think its about checkout_request data because it translates to this
 
2.5.0 :001 > '{"charge":{"amount":5,"currency":"EUR","capture":true}}'
 => "{\"charge\":{\"amount\":5,\"currency\":\"EUR\",\"capture\":true}}" 

Open in new window

and therefore signature is created with `\` before quote

question on stackoverflow: https://stackoverflow.com/questions/51506282/json-and-generating-signature
0
I'm trying to finish up a demo for a presentation at work and I'm stuck on how to get the calendar to display properly with the date selection added to the start date field.

I've zipped up the code for review - when you open the html file and click on the calendar icon, nothing happens. This was a copy/paste from Zoom.us on their Create Meeting page and only needed this part of the web page for my demo.

Any assistance is greatly appreciated!

zoom.7z
0
I'm returning data from an ajax request as json.
I have two queries that I execute when the request is made and the result is being sent back together as one variable ($vehicle).
Something like this:

My first query gets the various customer service reps for a given dealer using:

$all_csr = DB::table('users')
                  ->join('dealerships', 'users.dealership_id', '=', 'dealerships.id')
                  ->select(DB::raw('CONCAT(users.first_name, " ", users.last_name) AS csr'),'users.id')
                  
            ->where(function ($query) use($dealership) {
                  $query
                  ->where('users.dealership_id', $dealership->id)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'service_advisor');
                  })
            ->orWhere(function($query) use($dealer) {
                  $query
                  ->where('users.dealership_id', $dealer)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'service_manager');      
                  })
            ->orWhere(function($query) use($dealer) {
                  $query
                  ->where('users.dealership_id', $dealer)
                  ->whereNull('users.deleted_at')
                  ->where('users.banned', 0)
                  ->where('users.position_id', 'fixed_operations_manager');      
                  })
            ->get();

A second query is being returned from an API as xml for a given vehicle and I process something like this into a variable named $vehicle:

$obj = SimpleXML_Load_String($xml);

$vehicle = $obj->s_Body->RepairOrderContactVehicleGetResponse->Items->RepairOrderContactVehicle;

Lastly so I can …
0
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

I start with the following codes with mvc/json/c#
and I just want to know how to get the following items
Or there is easier way to get everything inside of json file. that will be great.


rating
open now
weekday text
viewport
photos height
photos html_attributions


https://developers.google.com/places/web-service/search

WebClient wc = new WebClient();
string jsonStr = wc.DownloadString("https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=37.753,-122.443&radius=10000&type=rv_park&key=AIzaSyCietasdfasdfasdfasdfxzD65Uc19X6DgrJFumdi-nCZYSHjg");
GooglePlacesResponse gpr = (GooglePlacesResponse)JsonConvert.DeserializeObject<GooglePlacesResponse>(jsonStr);
Response.Write(gpr.status + "<br><br>");

Open in new window

0
I am new to PHP OOP.

I am writing a web app for our company to create Mock API's - which will allow developers to write their code against a Mock API which will return a JSON object.

In its most simple form, it would look like this:

Html Form

Endpoint Name: _________
Method: [GET] [POST] etc
Response Body:_____________________________________________  ( Json Obj )

Open in new window


I understand the basics of creating a class. And defining the information we need. Such as...

class Api {

     private $id;
     private $apiName;
     private $apiMethod;
     private $responseBody;

     public function CreateApi(){
         // Create and insert API into Database
     }

}

Open in new window


My questions are:

1. If I was to have a Database class, how would I use it withing this API class? For instance, as you see below, I am setting a variable $pdo that I can use. How do I pass this into my Login so I can query the user table?

$host =  'localhost';
  $user = 'root';
  $password = '123456';
  $dbname = 'pdoposts';
  // Set DSN
  $dsn = 'mysql:host='. $host .';dbname='. $dbname;
  // Create a PDO instance
  $pdo = new PDO($dsn, $user, $password);

Open in new window


2. How would I structure my includes in this? For instance, do I require_once db_class on every page? For instance, do I do something like this:

include_once("db.class.php");
include_once("login.class.php");

etc , on every page????

Open in new window


3. Lastly, We have this project hosted on Godaddy. I am having problems seeing errors. All I get is a 500 page. I tried the following:

ini_set('display_errors', 1);
ini_set('log_errors', 1);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');
error_reporting(E_ALL);

Open in new window


that is not working. I still only get the 500 error page, not telling me anything.

Can anyone help me out? Thank you.
3
Trying to fetch ID in response that is stored in database of Post request. In table ID is autogenerated. tried one code but it is not working. Please suggest.

    public HttpResponseMessage Post(List<DelegateTable> delegatetable)
        {
            try
            {
                using (ShowContext delegateContext = new ShowContext())
                {
                    DelegateTable delegates = new DelegateTable();
                    List<DelegateTable> list1 = new List<DelegateTable>();
                  
                    foreach (DelegateTable item in delegatetable)
                    {
                       
                        delegates.Salutation__c = item.Salutation__c;
                        delegates.First_Name__c = item.First_Name__c;
                        delegates.Last_Name__c = item.Last_Name__c;
                        delegates.Account_Name__c = item.Account_Name__c;
                        delegates.Contact_Email__c = item.Contact_Email__c;
                        delegates.Category__c = item.Category__c;
                        delegates.Conference_Type__c = item.Conference_Type__c;
                        delegates.Conference_Selection__c = item.Conference_Selection__c;
                        delegates.Payment_Status_Interface__c = item.Payment_Status_Interface__c;
                        delegates.Barcode__c = item.Barcode__c;
                        delegateContext.delegates.Add(delegates);
                       
            

Open in new window

0
How to multiple update data using put method web api. I have used single update but i am unable to write code for multiple update.

   public HttpResponseMessage Put(DelegateTable delegatestable)
        {
            try
            {
             
                using (var ctx = new ShowContext())
                {

                    var delegatedata = ctx.delegates.FirstOrDefault(s => s.Barcode__c == delegatestable.Barcode__c);

                    if (delegatedata != null)
                    {
                        if (delegatestable.Salutation__c!=null)
                        {
                            delegatedata.Salutation__c = delegatestable.Salutation__c;
                        }
                        if (delegatestable.First_Name__c != null)
                        {
                            delegatedata.First_Name__c = delegatestable.First_Name__c;
                        }
                        if (delegatestable.Last_Name__c != null)
                        {
                            delegatedata.Last_Name__c = delegatestable.Last_Name__c;
                        }
                        if (delegatestable.Account_Name__c != null)
                        {
                            delegatedata.Account_Name__c = delegatestable.Account_Name__c;
                        }
                        if (delegatestable.Contact_Email__c != null)
                        {
                            delegatedata.Contact_Email__c = 

Open in new window

0
Hi guys,

I am curious about the benefits of using SDKs. Personally, I prefer avoiding third-party libraries, especially if I don’t see any benefits of having serialized JSON output in class models (I have found this to be the case when using JavaScript, NodeJS, PHP, Python, and other functional programming languages). When using serialized JSON models in Java, C++, C#, and ActionScript, I observed a decline in performance.

However, I am aware that companies including Google, Amazon, Salesforce, etc are generating REST API services for SDK code for developers to consume.
 
What have you found to be the main pros/cons of using SDK, and what are your personal preferences regarding which REST SDK is best for various languages?

Best,
David
0
Hi,

I'm just starting out writing a custom extension for VSTS; within task.json i have an input picklist ($location) thats bound to a datasource which retrieves a list of locations. I want to then use the selected location to filter the results for another input picklist. But the endpoint url does not contain the location and trying to filter the json result using $location in resultSelector does not return any results. (i have replaced $location in resultSelector with text to confirm the datasource is ok). Here's the code im using, any suggestions on where im going wrong please?:

"target": "networkSG",
"endpointId": "$(ConnectedServiceName)",
"endpointUrl": "{{{endpoint.url}}}/subscriptions/$(endpoint.subscriptionId)/resourcegroups/$(resourceGroupName)/providers/microsoft.Network/networkSecurityGroups?api-version=2018-02-01",
 "resultSelector": "jsonpath:$.value[?(@.location ==$(location))].name",
 "parameters": { "location": "$(location)" }
0

JSON

748

Solutions

746

Contributors

JavaScript Object Notation, or JSON, is human-readable text used when transmitting data objects consisting of attribute:value pairs between a server and a web application as an alternative to XML. JSON, while it is originally derived from JavaScript, is a language-independent data format. Code for parsing and generating JSON data is available in many programming languages.

Related Topics