Retrieve a specific value

Hello,

I am trying to retrieve the highlighted value in my expression, how can I do it?

image


—>
image


This is a query for the next request that matches rel=next

Thank you for your help, I’m learning a lot with you :slight_smile:

Could you please share output of previous node? Sharing workflow might be also helpful “_”

[
  {
    "body": {
      "header": {
        "statut": 200,
        "message": "OK",
        "total": 75,
        "debut": 0,
        "nombre": 20
      }
      
    },
    "headers": {
      "x-frame-options": "SAMEORIGIN",
      "cache-control": "no-cache",
      "access-control-allow-origin": "*",
      "access-control-allow-methods": "POST,GET",
      "set-cookie": [
        "INSEE=138986250.20480.0000; expires=Wed, 06-Jul-2022 15:24:53 GMT; path=/; Httponly; Secure",
        "pdapimgateway=2890449674.22560.0000; expires=Wed, 06-Jul-2022 15:24:53 GMT; path=/; Httponly; Secure"
      ],
      "vary": "Accept-Encoding",
      "expires": "Thu, 01 Jan 1970 00:00:00 GMT",
      "x-total-count": "75",
      "access-control-allow-headers": "authorization,Access-Control-Allow-Origin,Content-Type,SOAPAction",
      "link": "<https://api.insee.fr/entreprises/sirene/siret?q=siren%3A266900273%20AND%20etablissementSiege%3Afalse&nombre=15&debut=60>; rel=\"last\", <https://api.insee.fr/entreprises/sirene/siret?q=siren%3A266900273%20AND%20etablissementSiege%3Afalse&nombre=20&debut=0>; rel=\"first\", <https://api.insee.fr/entreprises/sirene/siret?q=siren%3A266900273%20AND%20etablissementSiege%3Afalse&nombre=20&debut=20>; rel=\"next\"",
      "content-type": "application/json;charset=utf-8",
      "date": "Wed, 06 Jul 2022 15:04:53 GMT",
      "transfer-encoding": "chunked",
      "connection": "close",
      "strict-transport-security": "max-age=100000; includeSubDomains"
    },
    "statusCode": 200,
    "statusMessage": ""
  }
]

This :slight_smile:

That should work:

{{$node['HTTP Request1'].json('headers').link.substring($node['HTTP Request1'].json('headers').link.lastIndexOf('<') + 1, $node['HTTP Request1'].json('headers').link.lastIndexOf('>'))}}

But this is spaghetti :smiley:

  1. I don’t know what is that format, so I cannot use any sophisticated parser or sth like that
  2. I would put this in function / function item node and separate index of last < and index of last >. You would like this and struggling with that LMK I’ll help you

Good luck ;))

2 Likes

Thank you, it’s true that it’s not great, but hey it does the job :rofl:

1 Like