I need to download data from my rest api

I need to download all the data from the api to the database on the device.
Can someone help me ?

You can successfully get any record from the database right?
Does the “Get record collection” work correctly for you?

If yes. You only need to:
0. Create the local data resource with the same schema as your rest api data resource. Exactly the same schema, else it may not work.

  1. Create a page variable “loopIndex”
  2. Do the “Get record collection” flow
  3. Do an “If” logic flow: with this condition:
pageVars.loopIndex<COUNT(outputs["Get record collection"].records)
  1. Do a “Create record” flow for the local data resource and inside it set this value:
outputs["Get record collection"].records[pageVars.loopIndex]
  1. Connect the successful output back to the input of the if formula.

After it created all records it will stop. Now a few things to note is that records on the local storage will have different id than in your rest api, so that can cause issues. Also it is always important to update also the rest api when you update the local data resource to avoid mismatch of data.