1 - Você precisa exibir num Dropdown as UFs que temos resultados. Atualmente são BA, CE, DF, GO, MG, PB, PE, RJ, RN, SE, SP;
Para isso, você pode, ao carregar a página, chamar a ação 'Listar UFs' e criar um segundo workflow > Set State in a Custom State e pega as ufs resultantes (Result of step 1) e seta em algum lugar. Depois, num dropdown você puxa essas UFs do custom state.
Você também pode passar a UF diretamente no campo dinâmico ou então criar um dropdown com os dados estáticos das UFs mencionadas. Se você usar uma UF diferente das disponíveis, não funcionará.
2 - Defina uma data para extrair o resultado. Dessa data, a API puxará também o dia da semana e a partir daí o passo 3.
3 - Horários: Cada UF e cada dia da semana tem horários diferentes. Quando você escolhe a data e UF, são exibidos os horários dessa UF e desse dia da semana.
Para obter a lista de horários, eu inseri uma ação ao alterar o valor do input data ou dropdown UF, aí a partir daí você realiza a chamada 'Retorna Horários'. E, assim como as UFs, armazena os horários em algum custom state e depois, no dropdown, puxa os horários desse custom state.
4 - Ao executar a ação de buscar o resultado, você precisará escolher uma ação de acordo com a UF e passar os parâmetros. Ex.: chamar a ação Resultado_DF no workflow e passar a UF, data do resultado e horário da extração.
Muito importante: Para manter-se atualizado acerca das instruções, acesse a página de demonstração. Lá tem o passo a passo e você pode fazer testes.
_____________________________________________
English:
1 - You need to display the UFs in which we have results in a Dropdown. Currently they are BA, CE, DF, GO, MG, PB, PE, RJ, RN, SE, SP;
To do this, you can, when loading the page, call the 'List UFs' action and create a second workflow > Set State in a Custom State and take the resulting UFs (Result of step 1) and set them somewhere. Then, in a dropdown you pull these UFs from the custom state.
You can also pass the UF directly in the dynamic field or create a dropdown with the static data of the mentioned UFs. If you use a different UF than those available, it will not work.
2 - Set a date to extract the result. From that date, the API will also pull the day of the week and from there step 3.
3 - Timetables: Each UF and each day of the week has different times. When you choose the date and UF, the times for that UF and that day of the week are displayed.
To obtain the list of times, I inserted an action by changing the value of the input data or UF dropdown, then from there you make the 'Return Times' call. And, just like UFs, it stores the times in some custom state and then, in the dropdown, pulls the times from that custom state.
4 - When executing the action to fetch the result, you will need to choose an action according to the UF and pass the parameters. E.g.: call the Resultado_DF action in the workflow and pass the UF, result date and extraction time.
Very important: To stay up to date with the instructions, visit the demo page. There are step-by-step instructions and you can do tests.
Editor:
https://bubble.io/page?id=retornadado&tab=tabs-1&name=resultado_jogo_do_bicho&type=page