If you're looking to import data from your app, you can use the query step. A query fetches records in a page-by-page manner through a process called pagination.
In this example, we'll "Import Issues from GitHub repository into Integry and store them in csv format" using queries.
- Go to the Flows tab from the top menu.
- Create a new flow.
- Search and select "Setup."
- Setup acts as a trigger in this flow and runs all the child steps.
- Setup doesn't require any configuration. Click Done.
- Setup acts as a trigger in this flow and runs all the child steps.
- Add GitHub in the child step.
- Add "Get All Issues" query.
- Click on "Add My Account."
- You will see a new window according to your app's authentication type. GitHub uses OAuth hence you will see the following window where you will sign in to your account.
- Authorize Integry to access your GitHub account.
- Enter the number of records you want to import.
- The records will be imported page-by-page, and the number you provide will be rounded off to the nearest page.
- Leave this field empty, if you want to import all records.
- Select the GitHub repository from which you want to import issues.
- Click Continue.
- Click Test.
- If the query executes successfully, you will get a list of issues from the selected repository.
- Expand Iteration 1 to view the results. Click "Next Page" to fetch more records.
- The number of iterations equals the number of pages of records the connected account holds.
- You can keep bringing the next iterations until all the records are exhausted.
- Click "Test Again" if you want to fetch the records again.
- You might want to fetch the records again if any change occurred in the fields of the records in GitHub, and you want to view the updated data.
- You might want to fetch the records again if any change occurred in the fields of the records in GitHub, and you want to view the updated data.
- Now that you have fetched all records from the selected GitHub repository, you can use them in the next steps.
- Click on the "Add Step" button.
- Search and select CSV.
- We will be converting the fetched data into a csv file.
- We will be converting the fetched data into a csv file.
- Add the "JSON to CS" action.
- This will convert the JSON object(s) coming in from the query step into csv format.
- This will convert the JSON object(s) coming in from the query step into csv format.
- Enter the delimiter to separate the csv records.
- Enter the JSON array to be converted into csv.
- You can either enter an array here or use dynamic tag(s) from the query step by clicking on the '+' button.
- You can either enter an array here or use dynamic tag(s) from the query step by clicking on the '+' button.
- Click Continue.
- Click Test.
- Your test will be successful when the fetched data is converted into csv format.
- Click Done.
- Click on the "Add Step" button.
- Search and select "File Append."
- We will use this step to save the csv output received in the previous step into a file.
- We will use this step to save the csv output received in the previous step into a file.
- Add the "Append File" action.
- Add the name of the file and its extension.
- Add the data to be stored in the file.
- You can add dynamic tag(s) from the previous steps here by clicking on the '+' button.
- You can add dynamic tag(s) from the previous steps here by clicking on the '+' button.
- Click on the "JSON to CSV" step.
- Click on the index of 'Out' to expand the output of the CSV step.
- Click on "Add to Field" in front of 'output' to add the tag from output to the Data field.
- Click Continue.
- Click Test.
- Your test will be successful when the csv data is converted into a file.
- Click Test Result to view the payload.
- The payload contains the location of the stored csv file.
- The payload contains the location of the stored csv file.
- Click Done.
- Save and publish your flow.
You can now access the stored file from anywhere. When your user will set up an integration using the above flow, they will be able to import all data from the selected GitHub repositories and convert and store it into a csv file.
Comments
0 comments
Please sign in to leave a comment.