Call A Flow From An iOS Shortcut

Call A Flow From An iOS Shortcut

This article provides the steps and resources to support the task of calling a flow from an iOS shortcut.

  1. Introduction
  2. Setup / Creation
  3. Javascript Code
  4. Interaction And Behavior

Introduction

Apple created the iOS Shortcuts feature, allowing users to create scripting widgets. This article describes the creation of a shortcut that calls a Fuuz flow. 

This shortcut must be run on a webpage because it runs JavaScript.

In testing, the Get Contents from webpage script never works correctly with a Post command. This prevents scripting from working anywhere else.

Setup / Creation

Create a shortcut.

  • Retrieve the Safari web pages input from the Share Sheet.

  • Run the JavaScript on Shortcut Input.

  • (Optional) Enable the Show alert option.

 

 

Javascript Code

The code uses basic JavaScript to make a post back to Fuuz.

var xhr = new XMLHttpRequest();

xhr.open("POST","https://api.customer-demo.mfgx.io/orchestration/executeFlow/iosTest" , true);

xhr.setRequestHeader('Content-Type', 'application/json');

xhr.setRequestHeader('Authorization', 'Bearer <API TOKEN HERE>');

xhr.onload = function() {

  completion(this.responseText);

}

xhr.send(JSON.stringify(window.location.href));

Interaction And Behavior

Wait for the shortcut to become available inside Safari.

It may be necessary to provide permission before running on a web page. 

 


Select the shortcut to call Fuuz.

(Optionally) Display the response as a message.

 

    • Related Articles

    • Call A Flow From A REST Post

      This article provides the resources and links to support the task of calling a flow from a REST post. Prerequisite Use The API Key Prerequisite This task requires an API key. Use The API Key The following information is a CURL example, using the API ...
    • Getting Started with Fuuz Scripting

      This article provides an introduction to Fuuz scripting and its relevant training resources. Fuuz Scripting Language Fuuz Scripting Windows Fuuz Scripting Language Fuuz's scripting language is an extension of the JSONata transformation language. Fuuz ...
    • Data Flow Schedules Option

      Open the Fuuz app. Select Fuuz → System → Orchestration → Data Flow Schedules dropdown menu. Or Type Data into the Search Bar: From here, it is possible to perform the following task or tasks. Search for a data flow schedule. Create a data flow ...
    • Data Flow Metrics Dashboard

      Open the Fuuz app. Select Fuuz → System → Orchestration → Data Flow Metrics Dashboard dropdown menu. Or Type Data into the Search Bar: From here, it is possible to search for and view the metrics for a data flow.
    • Data Flow Event Nodes

      Open the Fuuz app. Select Fuuz → System → Orchestration → Data Flow Event Nodes dropdown menu. Or Type Data into the Search Bar: From here, is possible to perform the following task or tasks. Search for a data flow event node. Create a data flow ...