Skip to first unread message

christop...@cesbron.com

unread,
Nov 19, 2018, 3:38:25 PM11/19/18
to MIT App Inventor Forum
Bonjour a tous
Je rencontre des difficulté à faire fonctionner mon projet
Je désire lire plusieurs colonne sur une sélection de ligne, ça fonctionne parfaitement avec une colonne mais quand je mais la deuxième j'ai une erreur voirhotos ci-jointe
Message has been deleted

christop...@cesbron.com

unread,
Nov 19, 2018, 3:43:26 PM11/19/18
to MIT App Inventor Forum
Je vous remercie d'avance de l'aide que vous m'apporterez.
20181119_153022.png
20181119_152822.png

Taifun

unread,
Nov 19, 2018, 3:50:37 PM11/19/18
to MIT App Inventor Forum
try a list from csv row block
Taifun

TimAI2

unread,
Nov 19, 2018, 4:05:34 PM11/19/18
to MIT App Inventor Forum
Also, it looks like you have one, but make sure you have a space after "contains" in the SELECT clause

You don't need the "global Response Content"...

christop...@cesbron.com

unread,
Nov 19, 2018, 5:52:07 PM11/19/18
to mitappinv...@googlegroups.com
Merci

Je n'ai plus de message d'erreur mais quand j'écris un texte dans texte1 qui correspond à une cellule de ma première colonne j'ai les cinq première ligne qui s'affiche dans label_text1 et dans label4.
Et je voudrais que seul les cellules qui correspond à la cellule texte1 s'affiche

Merci de votre aide

20181119_234058.png

Eric P.

unread,
Nov 20, 2018, 2:19:14 AM11/20/18
to MIT App Inventor Forum
Salut,
Je pense que ton problème vient de ta variable. Ici tu as initialisé la variable ResponseContent comme étant une variable de type texte et non comme une liste.
Tu n'as pas besoin de la déclarer car c'est déjà fait en interne dans la fonction. Du coup ça créé une confusion. A la place, j'aurais créé une liste vide qui réçoit le contenu de la réponse comme dans la pj.
Après es-tu sûr que la réponse possède plusieurs item? si tu as toujours l'item de l'index1 c'est peut être que qu'il y en a qu'un
Sans titre.jpg

christop...@cesbron.com

unread,
Nov 20, 2018, 7:31:02 AM11/20/18
to MIT App Inventor Forum
Bonjour
Et merci mais ça ne fonctionne toujours pas,
Quand j'écris dans texte1 une cellule de la colonne A
J'ai le contenue global de mais colonne B et C
Alors que je voudrais exemple : texte1: cellule A3
Voir dans labeltexte1: B3 et C3.

Eric P.

unread,
Nov 20, 2018, 11:55:49 AM11/20/18
to MIT App Inventor Forum
Je n'utilise pas de csv, ça viendra peut-être un jour :)
Donc ce que je comprends c'est que A = B+ C en quelque sorte et que tu veux afficher B et C dans des label différents?
Si c'est le cas et qu'il y a un séparatuer (comme une virgule ou point-virgule ou autre) tu peux essayer ça.

En gros tu récupères la réponse global dans un label et tu créés une liste ajoutera autant d'élément qu'il y aura de séparateur. Il te reste plus qu'à afficher les items concernés.
Je ne sais pas si ça va t'aider mais après je m'y connais pas encore assez pour t'aider.
Sans titre2.png

TimAI2

unread,
Nov 20, 2018, 4:39:44 PM11/20/18
to MIT App Inventor Forum
I believe this is what you want:

SCREEN

screenqueryrowdata.png


SHEET (data, see row 8)


sheetqueryrowdata.png


BLOCKS


blocksqueryrowdata.png



The query will pull back the header row and the row defined by the content of the textbox, in my case an ID number. 
You are provided with a list from a table (two rows with two columns)
You first need to select the 2nd row (2), then the items from that list (1 and 2)

Husain Sharbdeen

unread,
Nov 23, 2018, 5:01:32 AM11/23/18
to MIT App Inventor Forum
Really i need this please share block or video how do this please

Husain Sharbdeen

unread,
Nov 23, 2018, 5:07:31 AM11/23/18
to MIT App Inventor Forum
Please help me how do this project doing from beginning or send .aia file i can put url from google sheet please  

TimAI2

unread,
Nov 23, 2018, 5:14:21 AM11/23/18
to MIT App Inventor Forum
It is all there in the post above ^^^

If you haven't done it already....

Husain Sharbdeen

unread,
Nov 23, 2018, 9:51:34 AM11/23/18
to MIT App Inventor Forum
please share aia file 

christop...@cesbron.com

unread,
Nov 25, 2018, 5:50:23 AM11/25/18
to MIT App Inventor Forum
Bonjour
Merci pour votre aide précieuse.
La solution de TimAI2 fonctionne parfaitement
C'est exactement ce que je voulais.

christop...@cesbron.com

unread,
Nov 25, 2018, 6:00:18 AM11/25/18
to MIT App Inventor Forum
Bonjour,

J'ai Une autre question,
Maintenant je voudrais faire la même chose mais quand l'ID est sélectionné je voudrais qu'il me mais dans une listview les colonnes qui contient le même ID.

Mais je ne sais pas comment faire.

Pourriez m'aider ?

Merci

TimAI2

unread,
Nov 25, 2018, 7:08:58 AM11/25/18
to MIT App Inventor Forum
You have two ways of doing this (amongst others!), depending on your workflow.  (note: I have changed the textbox to a listpicker)

If you absolutely need to query the google sheet each time:

BLOCKS

blockspickIDandDisplay2.png


The query has changed to SELECT * where A = 

and you need to pick index 2 from the responseContent because index 1 is the header row from the list


If you can work with the whole table in your app, then you can bring this down when the app starts, any queries will be carried out on the app (you could always refresh the data as needed):


BLOCKS


blockspickIDandDisplay.png


When the app opens it calls the whole table down and places it in a list variable data. The listpicker selection is then used to add the correct data to the listview


The output is the same in each case


SCREEN


screenPickIDandDisplay.png




Husain Sharbdeen

unread,
Nov 25, 2018, 7:33:28 AM11/25/18
to MIT App Inventor Forum
Supper thanks is possible can i know step by step doing this kind of work if possible please share your .aia with sheet or send video link it is very usefull for me 

TimAI2

unread,
Nov 25, 2018, 7:43:48 AM11/25/18
to MIT App Inventor Forum
@ Husain Sharbdeen

Everything you need is presented here. If you creating your own apps by following the examples you will better learn how things work so that you can develop for yourself

christop...@cesbron.com

unread,
Nov 25, 2018, 8:35:20 AM11/25/18
to MIT App Inventor Forum
Merci,

Par contre je voudrais mettre l'ID dans une textbox pour entrer Manuel,
Puis dans mon fichier sheet j'ai plusieurs ligne avec le même ID, je voudrais afficher les ligne d'une meme ID dans une listview.

TimAI2

unread,
Nov 25, 2018, 10:20:02 AM11/25/18
to MIT App Inventor Forum
Can you please provide some example data you would have in your google sheet ?
Do you want to display all of the query response content in the the listview, or a set to choose from to display each record ?

christop...@cesbron.com

unread,
Nov 25, 2018, 12:49:22 PM11/25/18
to MIT App Inventor Forum
Bonsoir
Voici ce que je voudrais faire.

Merci

Screenshot_20181125_182046.jpg
Screenshot_20181125_182120.jpg

TimAI2

unread,
Nov 25, 2018, 4:15:20 PM11/25/18
to mitappinv...@googlegroups.com
OK

I have created a new dataset that contains many records with the same ID between the ID's of 1 and 15
When typing a number into the textbox (between 1 and 15), the query selects all records with that number as the ID
In the gottext event 
  • we add the responseContent
  • remove the first record (which contains headers)
  • convert each item in the list (which is itself a list) to a string and add each to a new list (this removes the parantheses)
  • display the new list in the list view
This should return as requested

BLOCKS

blocksselectquerymanyrecords.png


SCREEN


screenqueryselectitems.png


SHEET


sheetmanytoone.png



You may want to include a unique identifier for your records




christop...@cesbron.com

unread,
Nov 27, 2018, 1:46:45 PM11/27/18
to mitappinv...@googlegroups.com
Bonjour
J'ai un message d'erreur qui s'affiche
Le voici en pièce jointe

Merci
20181127_195442.png

TimAI2

unread,
Nov 27, 2018, 2:15:23 PM11/27/18
to MIT App Inventor Forum
There was no "list to csv table" block in my example....

Try "list from csv table"

christop...@cesbron.com

unread,
Nov 27, 2018, 6:07:01 PM11/27/18
to MIT App Inventor Forum
Effectivement petite erreur d'inattention
C'est parfait ça fonctionne très bien
Encore merci
Bonne soirée
Reply all
Reply to author
Forward
0 new messages