Data Transfer with the Web Component

Due to the problems I encountered using Firebase, which was an experimental tool, I took the trouble to migrate my blocks using the web component.

I have a few questions here; I hope you can help.

Regards

In this instance, I'm trying to retrieve data from an address that doesn't yet exist until it's saved. Firebase had this functionality.

How could I replace this with the web component?

I already checked it; it has options to get, save, delete, and replace.

But I didn't find anything like this (valueIfTagNotThere).

If anyone has an example, I would appreciate it.
Regards

Web component with Firebase REST API fully explained and exampled HERE

1 Like

I got it

Question: How can I use the same web component to retrieve data from other tags?

I'm getting an error this way.

Make the calls one after another. Wait until the response from the first call is in before making the second call.

1 Like

It looks good.

Is this the only way to do it in stages using buttons?

If I wanted to get the data when Screen starts, both at the same time with a procedure, is that possible?

Yes, put your second call (contents of Button 2.Click) at the end of the gottext for the first call.

Why can't I do something like this?

both at the same time in a single procedure

Because in the Web GotText event you can't know, which result has been received...

As it has been already suggested, do it one by one. see also sonething similar here how to do it App Inventor Tutorials and Examples: Webprefetch File by File | Pura Vida Apps

EDIT: Alternatively use 2 web components

Taifun

1 Like

These blocks retrieve items even when they don't exist within the tag.

Here it no longer exists (prueba6).

When I retrieve the item using the address and the tag doesn't exist yet, it sends me an alert.

How can I prevent it from sending the alert and instead send an empty response?

Show the raw response_content.

It's probably something that can't be parsed as JSON if you asked for a nonexistent branch of the database.

In that case, you would have to test it for that before attempting a JSON decode on it.