Hi
I’m using the following block to set a variable value to an item from a data viewer grid , So I can use it in the next screen as a parameter to filter an Api
And When running the code it give an api response of Null
What happens if you set app variable CategSelected to the value manually? For example, right above the set Categories_API's URL block, set it to a text string for the value you would have selected from the Data Viewer Grid. Does it work that way? If so, the problem is with retrieving the value from the data source. If not, the problem is with your API url.
Are you doing error checking for the API response?
That link does not contain the blocks in the first screenshot so it’s harder for me to test it. One problem is that you appear to have initialized two variables with the same name so you’ll need to fix that by deleting one of them and re-checking your blocks for any missing variables:
@tatiang
I think I figured out the problem, the variable value is placed between a colon sign, which is not interpreted by the api server resulting in a response of null.
I find that out after creating a new row in Google sheet containing the variable value so I was able to figure out the variable value,
I think the solution would be declare the variable value as text only without the colon sign
There is currently a glitch in which I reported that when you right click a valuable to create a “set variable block” or “get variable block”, it creates a second one in the list of variables. The variable that is created will always show as NULL. I hope this gets fixed soon as I’m sure a lot of users aren’t aware of this.
@tatiang
here is the new link https://x.thunkable.com/copy/666237e9ed96e3e057d240ece29de32f
the point is the values resulted from the API response are place automatically in quotation mark making it useless as API Url Parameter And causing the data viewer list unable to display images from the corresponding URL as it placed in quotation mark as you can see from that block
@tatiang
you can try it yourself , placing an image URL in Quotation mark , make the data viewer list unable to display that image , if you remove the quotation mark the images are displayed as usual