Unable to parse Web API response

hi

with this api I retrieve connection identifiers in web preview mode it works in live test it does not work in the application but in a simplified screen yes
and it worked before I feel like I’m wasting time for nothing…
in this first screen there is only the display of label and textboxes and using this web api call

1 Like

If you don’t provide details then we can’t help you.

2 Likes

hi

thanks for your support

I wonder if it’s the blocks that are to blame.

these blocks work in a simplified app and in web preview mode

update

on another phone it works (ios) but the data changed block no

What is the value of the green error block when it doesn’t work?

Do the blocks in your screenshot work:

  1. In web preview?
  2. Live tested in iOS?
  3. Live tested in Android?
  4. Downloaded to iOS?
  5. Downloaded to Android?

What does this mean?

1 Like

I believe he is using his own Google Apps Script and the issue could also be from that side not only from the app side.

Such issues are very difficult to resolve.

One thing I noticed in the code that the status is compared by 200 as a number but most API will return it as text. However, due to the fact that this API URL is self developed (I assumed) it will be difficult to say what it should be.

1 Like

Yes, I wouldn’t normally check for status=200. I would just see if there’s an error and if not, then get the response.

I agree that Google Script debugging can be difficult.

1 Like

hi

it’s good to have support
if i can allow myself in summary this web api call works under ios (live test), web preview on android (live test) in a reduction of my application but not in my application
this script you are concerned about will just fetch data from a spreadsheet and i use it in another application
I must have done something that blocks the web api

but there is a big downside is that it only works on IOs if the firebase rules are on true but that’s the subject of another post

it’s good to have support

if i can allow myself in summary this web api call works under ios (live test), web preview on android (live test) in a reduction of my application but not in my application
this script you are concerned about will just fetch data from a spreadsheet and i use it in another application
I must have done something that blocks the web api

but there is a big downside is that it only works on IOs if the firebase rules are on true but that’s the subject of another post

1 Like

can you please provide a minimal example that shows this discrepancy?

Does your app script require you to be logged in to execute?

1 Like

hi

can you please provide a minimal example that shows this discrepancy?Blockquote

i have already done it on my side a single screen and the call of the script the result stored in a label it works on android and on IOS and in preview mode
no to call this script I don’t need to be logged

Using the web preview? Or it doesn’t work when you use the companion app? Again, can you please provide a minimal example that shows this discrepancy? If I can reproduce the issue on my end I can file a useful bug report if there’s a bug to report!

Hi

I will provide you an example.

but I must admit that the recurring problem is related to firebase rules I thought it was enough to authenticate but that’s not the case when I think it works with android it’s because I use my account as muneer would say and when does it actually work with android, it doesn’t work with ios with the same rules enough to be discouraged

1 Like

how i send you ?

If you create project, you can share it here or send it in a DM. If it’s a minimal example, it should be fine to share here in the form as a ‘copy’

here is the link

https://x.thunkable.com/copy/3640773dee4296dbdf50ef7f2aca46f6

the same api call above doesn’t work in android

https://x.thunkable.com/copy/fbdcc98b20f180a3a9ac880d510d7753

@bibbi It would be helpful if you could provide a yes or no answer for each of these:

When I try it, these are my results:

  1. Yes
  2. Yes
  3. Yes
  4. (Haven’t tried, will update…)
  5. (Android download servers are not working…)

In each case, I see this:

hi

the first link :

  1. Yes
  2. Yes
  3. Yes

the second link :

  1. Yes
    2.Yes
  2. No
1 Like

“employees” is a list… why are you getting the object properties of that list? I see lots of problems with the way you are parsing the JSON response:

You don’t need the extra get object properties of block at the top of the loop. And since you’re getting list items and storing them in j, you can just use j… you don’t need to get the properties of “employees” over and over again. That’s already included in j.

Try this instead:

Here’s a modified project that generates a list of the “email” property values from the API:

https://x.thunkable.com/copy/c53c0dbe2f7706fe186b4660aa7d3640

And the result when Live Tested on Android looks like this preview:

image

thank you for this decisive support however if on my android your proposal indeed works my application extract which your observations do not work

I’m sorry, I don’t understand what you wrote. What is not working?

You can use the yes/no for #1-5 as I suggested above.