Posting multiple JSON values in same action

Hi everyone. I'm trying to post multiple values in multiple JSON messages from the same action. For example, I'm selecting a start time from TimePicker and I want to store hour and minute individually, which suppose two distinct posts to a database. The result is that only one value is inserted to the database. Does someone can help ?

Many thanks !

More information is needed on the REST API you are using.
Share with us a link to the API docs?

Use the Post method only once and add a Web.GotText event to get the result from the server

Taifun

This a custom API in Node JS (ExpressJS) that gets data from both Arduino controler and Android APP (MIT Inventor). The data is sent to the JS server that inserts a row in MySQL database. The code is quite simple; a JSON message is sent to API that insert the data in the database after. Everything work very well for other fields updated (many parameters entered from textbox). But for the TimePicker, I get 2 parameters (hour and minute) for a single action (startClock) and then I must call two POST from the same action and that is my issue.

Thank you !

The "WEB.GotText" which is a "When" cannot be inserted within a another "When". I tried a set without success.

image

Thanks !

I do not think so, therefore some documentation would help us to help you...

And if you really like to send 2 Post requests, send only one and in the Web.GotText event aftwr the first has been received then send the second

Yes, the Web GotText event is another event...
It looks like you should do some tutorials to learn the basics

A very good way to learn App Inventor is to read the free Inventor's Manual here in the AI2 free online eBook App Inventor 2 Book: Create Your Own Android Apps ... the links are at the bottom of the Web page. The book 'teaches' users how to program with AI2 blocks.
There is a free programming course here Course In A Box and the aia files for the projects in the book are here: App Inventor 2 Book: Create Your Own Android Apps
How to do a lot of basic things with App Inventor are described here: How do you...? .

Also do the tutorials http://appinventor.mit.edu/explore/ai2/tutorials.html to learn the basics of App Inventor, then try something and follow the Top 5 Tips: How to learn App Inventor

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Thank you Taifun. I'll do that!