This is actually working with no errors, I have the profile picture in Airtable, I get the list and compare the user who sent the message so I can get the position of the image in the list from Airtable.
As said before it is actually working, but for some reason I am still getting the error
generally before selecting something from a list make sure the list is long enough (i.e. for selecting the 1st item the length of the list must be minimum 1)
Taifun
I get your point, but if there is an error and my list is empty, my profile pictures should not be showing.
As the data has been already pre-set, I should not get 0 values.
Check where/when/how, in your workflow, global Messages is being populated. I would guess that your procedure is running once beforehand, resulting in the error.
Thanks so much for your reply. The problem is the ChatUserList. When I remove every block which contains this list, the problem disappears. I dont see any issue there… I tried with a timer, I delayed the procedure for 1sec, but nothing solved.
Nothing to do with the companion, it is the way your blocks work. You will always call tag=Message in the gotValue event block, therefore on the first run it calls it when there is no value. You need to add an if/else once tag=Message is returned, testing if it is empty or not.
I see it now. The issue is that when the gotValue event runs first time, to get the User, it then runs the rest of your blocks, including the ListMessages procedure. At this point Messages is an empty list, when it runs the second time to get the Messages, Messages has list content so everything is OK.
Move your call Spreadsheet2.GotColumn up into the last else if, with set global imageListFirebase and see if that works. If not, you may need it somewhere else…or set another if block to test if Messages and imageListFirebase are NOT empty before calling it.
Just tried the other way around. calling first Airtable data, but the problem still persists. Also tried getting the lenght of all my lists, everything happens so fast that I dont get where is the problem
Well that is not what I suggested Your problem was the double call in GotValue with their being no content in Messages on the first call. You need the if/else in there to test if Messages is empty (or NOT) before calling the Spreadsheet2.GetColumn-Image block
My problem is actually with the list called UserList, look, Trying to verify if there is data, my app just shows 0 values. I know that is because image field was not called, but at that point UserList should have values already