How to Extract Data from HTTP Module: A Guide for Make.com Users

Have you ever found yourself in a situation where you need to extract a specific piece of data from the output of an HTTP module (API call)? This can be a tricky task, especially when the exact location of the data changes every time. In this blog post, we'll walk you through a step-by-step solution to this problem.

The Problem

Let's say you're trying to extract the "message" data from the output of an HTTP module. The "message" data shows up in the output, but whenever you try to map to that field from another module, you get an error that no data was found. This is likely because the exact location of "message" changes every time. It's always found when type=text, but it can be found in a different "trace" collection every time. So it could be #1, #2, #3, or #4 and you don’t always know which one it’ll be.

The Solution

The solution to this problem is to set a variable using the output of the Parse Data module. The logic should be something like this: the only variable that determines where the message can be found is when text=type.

Here's the logic that ultimately got the desired result: map to the Collection's "payload.message" when the Type is equal to "text". This will reliably extract the data you need.

Troubleshooting Tips

If you're still having trouble, remember that 'trace' is an array with potentially multiple data points. Therefore, use the map function as demonstrated above. Also, keep in mind that you have two options: either you can directly map the data, or you can use the map function.

Conclusion

In conclusion, extracting a specific piece of data from the output of an HTTP module can be a challenging task, especially when the location of the data changes every time. However, by using the map function and setting a variable using the output of the Parse Data module, you can reliably extract the data you need. We hope this blog post has been helpful in guiding you through this process.

You do have further questions?

Ask your question via E-Mail: Richard@make-app.de
Book a paid Support & Consulting Session
New Make.com user? Sign up through this Affiliate Link to receive 10.000 operations for FREE.