Set Custom State from a list of results from API

I called an API and it returns a list of results based on different countries. (e.g. the list shows the the market risk premium of different countries)
I want to store the risk premium percentage for a particular country, say USA into my custom state variable.

I have an action to Set State.
But I can’t figure out how I can go through the list and only put the premium for USA into the variable?

This is what i was trying

can someone enlighten me?
Thanks

you need to use :filtered function. It’s a little it hard to tell you exactly where because I don’t know the payload of the API response, but from your screenshot, Should be Result of step 12 (FMP - Get MarketR):filtered (where countryRishPremium = USA):first item

This topic was automatically closed after 70 days. New replies are no longer allowed.