API Works but Won't Load Values for DB Insert

Hi there! :smiley: :+1:

I have an API call to get variables about a home property (lot size, etc).
I’m running it on the server side as an Action Step. It works great.

The lot size and other info are under the “Records” object that the API returns. I can see all those components of the “record” on the App Structure (user visible side).

But, when I try to do an Action Step right after the API and update the data into my Database, Wappler won’t show me the different data components of the API call. It just wants to show me that I have received data.
See the image.
There should be data under there - I can see there is on the app structure side.

What am I doing wrong?
Shouldn’t I be able to insert the value of the API return into my DB?
THANK YOU!

  • Jeff

And just FYI, I have done the “Define Schema.”
I can output anything I want from the API on the user’s page. I just can’t follow it with a Database Update.

I’ve tried doing a Repeat Region (even though it’ll only return 1 result) but that doesn’t seem to help, either.

21 hours later, I have it figured out. :joy:

I started hand coding it, and it helped my thought process.
If anyone else runs into this problem I think what I did wrong was that I put the repeat in the wrong place.

The wrong way:

API / Result
Repeat
Condition (If API has data)
Database Update

The right way:

API / Result
Condition (If API has data)
Repeat
Database Update

2 Likes

Well done - yes by exploring more options, you learn along the way :slight_smile:

1 Like

Yeah, just wish it didn’t take me so long, hahah!

@George could you help me understand why the Condition must be prior to the repeat?

It all depends on what exactly the server action steps and what exactly is set as expression there in the steps.
Also it depends on what exactly is not working?

When the Repeat was prior to the Condition, Wappler wouldn’t show the data inside the Array/Object (same as the picture above, but with a repeat in there).

Please post some screenshots of what expressions are selected in your steps exactly and also an overview of all the steps in there so we can see what have you tested.