I am trying to create a two conditions in Col"B" and Col"L" if matches then take the ID Number from Col"P" and get the result in JSON.
JSON appear like this:
{"id":16,"sku":"4926","productName":"Diforda","upc":"test",
"condition":"test","uniqueID":1234,"logsCey":3,
"Processing":true,"addedDateTime":"2021-06-22T04:07:35.15",
"softDelete":false,"newLogno":776655}
After that code will find in JSON where Processing = True then take the newLogno from JSON and paste that in Col"A" against same Row if it is False then repeat the same process for 2nd ID Number from Col"P".
If someone can please share a solution i would really appreciate.
Sub Testing()
Dim objRequest As Object
Dim strUrl As String
Dim blnAsync As Boolean
Dim strResponse As String
Dim idno As Variant
Dim ws As Worksheet
Set ws = Sheet4
LRow = ws.Range("B" & ws.Rows.Count).End(xlUp).Row
For r = LRow To 2 Step -1
idno = ws.Cells(r, "P").Value
If ws.Cells(r, "B") <> "" And ws.Cells(r, "L") = "Tenu" Then
Set objRequest = CreateObject("MSXML2.XMLHTTP")
strUrl = "URL" & idno
End If
blnAsync = True
With objRequest
.Open "GET", strUrl, blnAsync
.setRequestHeader "Content-Type", "application/json"
.send
While objRequest.readyState <> 4
DoEvents
Wend
strResponse = .ResponseText
End With
Next
strResponse = ws.Cells(r, "A")
End Sub