PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → Managing external API responses with dynamic JSON structures
Managing external API responses with dynamic JSON structures
Débuté par spiderrr goat, 07 avr. 2026 14:05 - 1 réponse
Posté le 07 avril 2026 - 14:05
Hello everyone,

I'm currently working on a WINDEV 2024 project that consumes several external REST APIs. The challenge I'm facing: some APIs return JSON responses where the structure changes based on the request parameters (e.g., optional fields appear/disappear, or data types vary).

Right now I'm handling this with JSONToExtract + manual error checking for each possible field. But the code is getting messy fast — lots of IF statements and EXCEPTION blocks.

Has anyone found a cleaner way to handle dynamic or unpredictable JSON structures in WLanguage? Ideally something that:

Doesn't crash when a field is missing

Can infer types on the fly

Plays nicely with nested objects

I came across a discussion about dynamic data parsing in other environments (not WINDEV specifically) that gave me a few ideas at https://happymodd.com.br

But I'd love to hear how this community approaches the problem natively in WINDEV. Are there built-in functions I'm overlooking? Or do you pre-process the JSON with a script before feeding it to JSONToExtract?

Thanks in advance for any pointers!
Posté le 09 avril 2026 - 09:27
spiderrr goat escribío:
Hello everyone,

I'm currently working on a WINDEV 2024 project that consumes several external REST APIs. The challenge I'm facing: some APIs return JSON responses where the structure changes based on the request parameters (e.g., optional fields appear/disappear, or data types vary).

Right now I'm handling this with JSONToExtract + manual error checking for each possible field. But the code is getting messy fast — lots of IF statements and EXCEPTION blocks.

Has anyone found a cleaner way to handle dynamic or unpredictable JSON structures in WLanguage? Ideally something that:

Doesn't crash when a field is missing

Can infer types on the fly

Plays nicely with nested objects

I came across a discussion about dynamic data parsing in other environments (not WINDEV specifically) that gave me a few ideas at https://happymodd.com.br

But I'd love to hear how this community approaches the problem natively in WINDEV. Are there built-in functions I'm overlooking? Or do you pre-process the JSON with a script before feeding it to JSONToExtract?

Thanks in advance for any pointers!


Nice question — handling external API responses with dynamic JSON structures can definitely get tricky, especially when the schema isn’t fixed. The key is building a flexible parser that can adapt to changes and gracefully handle missing or unexpected fields. Using robust error handling and validation checks makes a huge difference in keeping your application resilient.

Interestingly, similar principles apply when working with modified apps like socials— you’re often dealing with extended or non‑standard features, so it helps to understand how the underlying structures are handled and how data is parsed/synced across different versions. Whether it’s JSON in your backend or message formats in apps, building flexibility into your logic makes everything more stable.

Have you tried mapping the JSON dynamically into typed objects yet, or are you exploring other parsing strategies?