How to extract data from JSON based on condition?

Status: Closed · Asked by bonordlin on · 0 views

bonordlin — Question ·

From an API I get a response like this

2. Response : [{"2267605":"UH-Karriar_Amandas_ m annons och partner"},{"2273773":"UH-Karriar_Amandas_ 2 nyheter m annons och partner r"},{"2276783":"UH-Upphandlare_Amandas"},{"2276790":"UH-Leverantör_Amandas"},{"2279120":"INKO_Upphandlare_Amandas- plats, annons, utbildning och Partner"},{"2279626":"INKO-leverantörer-Amandas_annons, utbildning och Partner"},{"2280986":"UH ...

I would like to
1) Grab the last post where the test starts with "UH-upphandlare" and grab the preceeding number (in this case 2276783) and use that number in a subsequent step in Pabbly.
How do I identify the last entry that contains a certain string, and how to I obtain the number accompanying that string?

Pabblymember11 — Reply ·

Hey @bonordlin

You can make use of the Code by Pabbly action step to break the JSON into two parts or more. With the help of OpenAI, you generate the code accordingly.

Back to all forum threads · Log in to reply