If boolean set nested field

Hi all sorry this is probably a simple answer but nothing stood out or I have my syntax wrong.
I want to set additional nested JSON if a JSON boolean is true.
Ex:

Car.own is true
Then set
Car.State to a random value from Type “State”

I have this:
if field(‘Car.own’) == ‘true’ then from_dataset(“State”) end

Hi @hellojuan I would pull the state field into a hidden field first within the array, then use this formula:
if field("own") then field("__state") else '' end

If you are referring to a field within the same array then you can miss off the root element. See this example: