Valor da taxa de entrega de acordo a quilometragem App Delivery

criei uma tabela com inicio fim e taxa
0000 1000. 9.00
1001. 2000. 10.00
2001. 3000 11.00
a referencia de distancia vem do google distance Matrix,
se as entradas retornaram no caso 2620 eu queria mostrar o valor de R$ 11,00
alguem pode me dar uma força? ou indicar onde posso aprender isso,
nao sei como fazer o se maior ou igual os campos tal, enfim, parei nisso

Hi @rsobral! From what I understand, you have delimiters, in this case:
Here is a print so that maybe it can help you with some ideas.

0000-1000 = 9.00 (delimitador A)
1001-2000 = 10.00 (delimitador B)
2001- 3000 = 11.00 (delimitador C)

in the database it is like this
so, for example, if the value returned from google distance matrix is ​​2550, I want to show the value referring to the distance from 2001 to 3000 meters, and this is current currency TOTAL = R$ 9.82

This data comes automatically through the goggle matrix, you said, right? So, two text elements will be filled in. So, in the third text element, you will receive the value corresponding to the conditionals, which you have and are 3. If the distance is 2550, then you will have to have conditionals for the value between the distance of 2001 and 3000, generating the value x. And so on for the other two limiters that you have.

1 Like

That’s right! But how to do it?


The most I could get was a :yes

Ola @rsobral , você é brasileiro ? ali onde voce tem o valor da corrida é um elemento texto ?

Bom dia meu amigo, sim, sou brasileiro, e ali é um elemento de texto,

@rsobral , prazer sou Nestor, sou de itajai sc, seguinte ali no elemento texto, voce pode usar as condicionais, como vc ja tem os delimitadores, por exemplo vc tem de 0 a 1000, ele vai gerar um valor certo(acho que é 9), então nas condicionais, vou mandar o print aqui da minha ideia de condicionais dentro do que vc mencionou de limitadores e precos. No meu exemplo fica alterando da tabela 1 dois e tres, mas ao inves de vc usar o texto como resposta vc usa o seu valor(ou o calculo que vc usa para distancia e minutos dentro dos teus limitadores), dessa forma vc tem dois valores que são os que o google (API Distance Matrix) te retorna, acredito que ele deva ter a distancia em numeros / pelos minutos, acredito que deva ser convertido em segundos. Acredito que seja por esse caminho esse cálculo. Nunca usei essa API. Mas seu layout ta bem bacana.

1 Like

eu chego a conseguir visualizar ali no valor da corrida, a distancia em metros do Google Distance Matrix, nao sei se ali no Banco de Dados, teria q ser diferente, ao inves de os metros, com inicio numa coluna e um final numa outra, talvez tenha de criar como range, numa coluna só, ali no seu exemplo, eu teria que criar uma tabela nova somente com 1 linha, ou ja definis o valor ai como texto,

Vamos la, se você esta cobrando 1000 metros(1km) é 9 reais, se 1000 é 9 reais dividido por 1000 vai resultar em 0,009 por metro. Então se a pessoa andar 300 metros ela vai pagar 300 m x R$ 0,009 = R$ 2,70 , caso você esteja falando em custo proporcional. Agora se você esta falando em custo fixo, então são somente 3 opções(condicionais) primeira condição: de 0000-1000 Metros custa 9 reais, nem que ele ande 10 metros, o custo sera sempre o mesmo. Qual é sua ideia sobre o custo ?

Isso mesmo mano, ai seria o custo fixo, independente se ele ande 100 metros ou 1000 metros,
a base seria essa tabela abaixo e o valor de referencia vem da API, e vem no formato, Ex. “2504”,
ai o que quero é pegar essa distancia, buscar nessa tabela, e imprimir na tela o valor correspondente a essa range,


Rapaz, vc mora no melhor lugar do pais! parabens!

@rsobral , olha só nessa listagem temos 27 range’s. Esses range são fixos, e se alterar algo será o valor da corrida ?

O Valor da corrida é gerado dessa coluna VALOR,
se o numero que veio da API, dizendo que a distancia é 2652 entao a taxa de entrega é R$ 9.30

You don’t need multiple conditionals for this.

If you already have a table where you store this data , the distance range and the fixed value, you just need to filter this based on what you receive from API. So, for example…

Do a search for Table where Início >= {km_min} and Fim <= {km_max} :first item {VALUE}

2 Likes


the most I could get with a :yes

here in the dialog there is a print of 2 tables, one in the bubble bank and another from a spreadsheet that I use in a google form,

now he decided to deny it


Your expression will be always validated as a boolean value due the way you are doing it.

But apparently you are getting some reference in the group itself, what expression you are using to get this data source and why you are doing this in the group instead return the value of the search directly?

Sorry but I’m still ignorant about bubble, the first time I heard about it was on 12/22, today is 14 days, if I managed to get to this point, I believe I should keep trying and looking for help, this was my first request for help, and something is already coming out, bubble is incredible, I’m hooked!

I’m taking the reference in get data from an external API in google matrix distance

resolvido!!