Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rob 22 posts 133 karma points
    Dec 02, 2021 @ 10:54
    Rob
    0

    Pull a data set from jSon by property

    Quick Question... but as usual simple things seem to evade me :)

    If I have a basis data set from a json String that looks like this.

    [{"ADDTOBASKETURL":"https://website.com/product/url","PRODUCTID":16813}, {"ADDTOBASKETURL":"https://website.com/producturl","PRODUCTID":16814},{"ADDTOBASKETURL":"https://website.com/producturl","PRODUCTID":16815},{"ADDTOBASKETURL":"https://website.com/producturl","PRODUCTID":16816}]

    I am calling the whole thing in from a url.

    var URL ="https://urleofthejsonstring";
    var jsonC = new System.Net.WebClient().DownloadString(URL);
    var decodedJsonString = Json.Decode(jsonC);
    

    Is it possible to just get one product into an array by its PRODUCTID I can do this by looping through and picking it out when it matched but I am sure the should be away of just taking it via a query or filter, if so how would I do this.

    Regards

    Rob

  • Rob 22 posts 133 karma points
    Dec 08, 2021 @ 17:04
    Rob
    0

    Sorry to bump but thought this would be simple :D

Please Sign in or register to post replies

Write your reply to:

Draft