I am connecting to an external API service shown here:
As you can see it returns VOLUMES of information but I only need a small fraction. I am trying to have it tell me the field names, drop down values, and a few other pieces of information of what I have setup in Salesforce.
To access the information I want, I am using the HTTP codeless logic and taking the entire data and putting it into an object…then extracting an element down a level…then again…then again. The way I am doing it seems inefficient. Is there a better way to get this nested data? Can I just tell the system to get the information I want when I pull it out the first time?
I am trying to get the Field names from the account object in Salesforce. What is shown below works for that purpose but I would like to create a nice function that I can reuse for other tables in salesforce that isn’t going to SLOW things down and allows me to get exactly what I want. Plus, I am sure harvesting the right data from an external API call will come up again for me or someone else!
Here is what I have thus far after I get everything in the HTTP block from the API call:
Also, it is not necessary to select one property at a time, you can insert the “Get property” block into each other, thus building a chain of calls.
There is also another approach for accessing nested data in objects by using dots notation (
Awesome, these examples are really helpful! Thanks so much!
One thing I discovered is that you have to provide a subsequent value for a nested array as TEXT and not a number. I would never have figured this out if you didn’t post the dots notation. You have to convert the array index to a text from a number. This seems to be especially true if you are using a loop to count the index. If you feed a number without converting to text I don’t think it will work. Here is the block I did that I got to work.
Note that the codeless block notation is also in reverse order from the dot notation.