Workflows Tips #8 – Time-Based Use Cases, User Sign in Attempt Card, and Flow Backup to GitHub or Google Drive
Tags: nocode, workflows, okta, oktaworkflows
Published: 2022-08-18 20:33:14

---
title: Workflows Tips #8 – Time-Based Use Cases, User Sign in Attempt Card, and Flow Backup to GitHub or Google Drive
published: true
date: 2022-08-18 04:45:32 UTC
tags: NoCode, Workflows, Okta, oktaworkflows
canonical_url: https://maxkatz.net/2022/02/18/workflows-tips-8-time-based-use-cases-user-sign-in-attempt-card-and-flow-backup-to-github-or-google-drive/

---

Welcome to another Okta Workflows Tips post. [Read](https://dev.to/oktaworkflows/okta-workflows-tips-57bj) all other tips.

In this post:

- Set table column field type correctly for time-based use cases
- Get notified when a user signs-in outside a participating country
- Automatically backup a flow or a folder to GitHub or Google Drive

## Set table column field type correctly for time-based use cases

⭐ This tip is from [Ajay Seetharam](https://www.linkedin.com/in/ajayseetharam/), Cloud Enterprise Architect at Okta.

In many time-based use cases there is a need to execute a workflow based on a schedule and then retrieve the rows that have a timestamp before the current date-time. For the **search rows** condition to work correctly the column field type has to be set to **Date**.

[![Setting column type in a table](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_timecolumn.png?w=828)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_timecolumn.png)
<figcaption>Setting column type in a table</figcaption>

So an entry in such a table would be populated as shown in the example below:

[![Workflows table](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_tablewithdates_sample.png?w=950)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_tablewithdates_sample.png)
<figcaption>Workflows table</figcaption>

The table is used in a flow with a date comparison to retrieve all rows prior to the current date-time

[![Searching a table by date](https://katzmax.files.wordpress.com/2022/02/workflows_tips_flow_getearlierdates.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips_flow_getearlierdates.png)
<figcaption>Searching a table by date</figcaption>

This picks out the correct row: 

[![Testing a card](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_dates_flow_testing.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_dates_flow_testing.png)
<figcaption>Testing a card</figcaption>

Unexpected rows would be returned from the **Table – Search Rows** card if the column type is set to the default **text**. 

## Get notified when a user signs-in outside a participating country

⭐ This tip is from [Ashwin Ramnarayanan](https://www.linkedin.com/in/ashwinramn/), Solutions Engineer at Okta.

Get a notification when a user signs-in into your organization from outside a participating country. Keep a list from which countries users are allowed to sign-in. When a sign-in occurs from a country not on the list, you will be notified. This flow uses **Okta – User Sign In Attempt** card. This event has information from where geography the sign-in happened.

[![Flow to get notified when a sign-in happens outside of a participating country](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_user_signin_notification.png?w=1024)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_user_signin_notification.png)
<figcaption>Flow to get notified when a sign-in happens outside of a participating country</figcaption>

The flow works like this:

1. User attempts to sign-in ( **User Sign In Attempt** ) event
2. Retrieve geographical information and whether the attempt was successful ( **Object – Get Multiple** )
3. Search a table to see if the sign-in country matches one of the allowed countries from the list ( **Tables – Search Rows** )
4. If a country was found ( **Branching -Continue If** ) and a sign-in was successful ( **Branching** -Continue If), create a message ( **Text – Compose** )
  - The message can be sent via email, as a Slack message, or SMS

[![Table with participating countries](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_table_countries.png?w=930)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_table_countries.png)
<figcaption>Table with participating countries</figcaption>

## Automatically backup a flow or a folder to GitHub or Google Drive

Use **Flow – Export Flow** card and **Folders – Export Folders** card to save and back a flow or a folder to GitHub or Google Drive.

[![Back up a flow or a folder](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_elements_flows_folders.png?w=770)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_elements_flows_folders.png)
<figcaption>Back up a flow or a folder</figcaption>

Example of a flow that saves backups another flow to Google Drive:

[![Uploading flow backup to Google Drive](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_flow_export2.png?w=922)](https://katzmax.files.wordpress.com/2022/02/workflows_tips8_flow_export2.png)
<figcaption>Uploading flow backup to Google Drive</figcaption>

You can schedule to run this flow periodically (automatically) or run it manually by clicking **Test** button.

That’s all for now. Let me know if you have any tips you would like to share.

🍉 Try this step-by-step getting started tutorial: [Build Your First Automation With Okta Workflows: Notify When User Is Suspended](https://dev.to/maxkatz/build-your-first-automation-with-okta-workflows-notify-when-user-is-suspended-1l3p-temp-slug-2933517).