Issues with an API ction

Dear Community,
I just joined Wappler and I’m currently learning…
So I was following HyberByte’s Youtube tutorial as a start.
https://youtube.com/playlist?list=PLUjqTJN3byC9W9UFjsV9f9vefe_ZSFQfb&si=2hgaXhPUrt3c15Dr

Everything works out quite nice, except one thing I don’t understand…
In tutorial “Creating your first API action - The registration process” there is shown how to select in the 2nd insert execution a return value from the first insert, in order to populate the user_id field in the role table.
When I follow the steps like in the video, and hit the little lightning icon for selecting the value, there are no return values from the first insert. I’m attaching a screenshot.

I’m wondering where my mistake is.

Could you please be so kind and advice?

Thank you very much

Blind

Welcome @BlindOracle,

Please share a screenshot of your serveraction… Let us see what your previous steps are

Hey @famousmag,

thanks for your quick reply, I’ll attach a screenshot.

Hi Hyperbytes!
Thanks for your reply…
But I’m looking for creating the user_id value in the role table.
I believe that password hash is not the correct one.
In your example it should be “insert.identity” and that one is missing on my side.

1 Like

Welcome to the community!

Sometimes I have to save and close the api (register.json) and re open it again, try that

OMG!
I just realized that it works…I just needed to reorder my executions :sa:Thanks guys! :smiley:

1 Like

Glad you solved it my friend.
We all thank @Hyperbytes for the knowledge he has passed to us with his videos !!

2 Likes

Absolutely true!
Thanks SO much @Hyperbytes, your tutorials helping me alot getting into Wappler!

I got another question, now I’m hanging at the chapter “Validating the code and confirming the account”.
I went through all of it 5 times now and can’t figure out why I’m receiving an unauthorized notification, when submitting code and e-mail address. I believe it’s the single query, as I have no clue what else it could be. If it was a shell script I’d add a lots of echos in order to troubleshoot, where the issue happens or at least run in debug mode. How can I achieve that in Wappler?

Thanks very much!

Cheers
Blind

Well! Don’t be shy and post those screenshots in order to see what’s going on.

You mean this?
https://community.wappler.io/t/debugging-server-connect-errors/2857

You can use set value steps with output set to echo values in the api response

Good morning,
thanks for taking so much care of my issue! I spent another hour now, digging through my code and comparing everything with the video advise again… I’m still getting back an unauthorized notify. Here’s the Chrome Dev/Console output:

So, my register page works, on data input the authcode is sent via E-Mail. I also checked if the mailed code is same as in DB. And I’m getting transfered to the validation page. Here I enter my details. Then immediately I’m receiving that unauthorized.


What bothers me is that error 404 in the Console output as you can see.
Would anyone have an advise on how to proceed? Thanks so much!

Blind (Happy sunday!)

I think we need some screenshots of your api action.

Hi Hyperbytes,

thanks. Here’s my API actions:






OK, think i have spotted the problem, your api action name has a space in it.

instead of “validatecode” you have “validate code”

spaces break API actions

remove the space or replace it with an underscore

OMG! It does do the job… :s Except that tables role.user_id and user.validated staying empty and user.authcode will not be deleted.

Thanks SO much!

I forgot:
role.role (with value M for member) does work.

yes, the role must match the entry in the security provider

Hi everybody,
thanks so much for all your help, I’m getting into Wappler very well, but I discovered a serious problem with the SQLite DB…
I tried to creaste those authroles table and it looks like my DB got messed up totally. I can’t apply the changes to the DB nor to data created within, but wappler insists the table is there. Also when trying to delete the table, it says it did but a refresh will show it’s still there, but with a number of changes indicating on the “Apply changes to DB” icon. I restarted my Mac, Wappler and everything, simply no efect. I can’t go on at this point as this table is stuck.

Anybody maybe any ideas how to fix it? I’ll attach a bug report #1695829976736

Thanks!

Try a full schema refresh, sometimes when making changes the schema is not correctly updated which would cause that error

image

Hey Hyperbytes! :slight_smile:
Yah, in my case I couldn’t fix it after messing it up, so my solution was to pull an older version of that DB file from the git repo.
Cheers!