Locoia
  • Overview
  • Account and User Settings
    • User types
    • Adding Users
    • Teams
    • Access Permissions
    • 2 Factor Authentication 2FA
    • Versioning and Snapshots
    • Activity Log
  • Reset your Password
  • Invoices and Payments
  • Automation
    • Flow Builder
      • Flow Building Best Practices
      • Jinja Template Language
        • Jinja: (Custom) variables, wildcards and functions
        • Magic Code Samples
      • Connectors & APIs
        • Titles and References
        • Referencing data of objects, lists, arrays - how to pass data dynamically
        • Accessing Objects with JSONPath
        • Merging nested JSON objects
        • Parsing JSONs from String
        • Response Headers & Status Codes
        • Custom Data Fields
        • Wildcard API calls and actions
        • Response cleaning
      • Text Strings, Date & Time, Numbers and Currencies
        • Text and Strings
        • Dates & Time
        • Numbers (Thousand Separators, Currencies)
      • Email-formatting
      • Code Fields
      • Running single Flow steps
      • Flow run data retention, logging, and error notifications
      • Advanced View
      • Dynamic Title
      • Custom Error Handling
      • Error Handling Flows
      • Automatic Pagination
    • Flow Debugger
      • Automatic Retrying
      • Run Flows again
      • Troubleshooting Flows
    • Community Library
  • Connectors & Helpers
    • Connectors
      • Monday.com
      • ActiveCampaign
      • Aircall
      • Allthings
      • Amplitude
      • Animus
      • Assetti
      • Awork
      • AWS RDS Database - How to connect
      • bubble.io
      • Casavi
      • Chargebee
      • CleverReach
      • comgy
      • commercetools
      • Everreal
      • Exact Online
      • Facebook Marketing
      • Fahrländer Partner
      • FastBill
      • FILESTAGE.io
      • Freshdesk
      • Freshsales
      • Google Ads
      • Google Ads Lead Form
      • Google Analytics
      • Google Chat
      • Google Drive
      • Google Sheets
      • Gmail
      • HubSpot
      • Heyflow
      • iDWELL
      • ImmobilienScout24
      • Instagram Ads
      • Intercom
      • klaviyo
      • Kiwi Opening Doors
      • Klenty
      • Klipfolio
      • Kolibri CRM
      • konfipay
      • KUGU
      • Shopify
      • S3 AWS
      • SQS AWS
      • Lambda AWS
      • Learnster
      • lexoffice
      • LineMetrics
      • Linkedin
      • Locoia
      • Notion
      • MailGun
      • Makula
      • Microsoft Dynamics 365
      • Microsoft OneDrive
      • MixPanel
      • MongoDB
      • Odoo
      • OnFleet
      • OnOffice
      • Oracle NetSuite
      • Outbrain
      • Quickbooks
      • Trello
      • PandaDoc
      • Personio
      • Pinterest Ads
      • Pipedrive
      • Plentific
      • PriceHubble
      • relay
      • REALCUBE
      • Sage ERP
      • Salesforce
      • SAP
      • Scoro
      • Seafile
      • sevDesk
      • SharePoint
      • SharpSpring
      • Slack
      • Snapchat Marketing
      • Snowflake
      • Teamleader Focus
      • Teamwork.com
      • Tableau
      • TikTok
      • TinQwise
      • The Trade Desk
      • Twitter
      • Typeform
      • WordPress
      • Xero
      • Youtube
      • Zendesk
      • Zoho CRM
      • Zoom
    • Helpers
      • Scheduler
      • Webhook
      • Dict Helper
      • Spreadsheet Helper
      • REST Helper
      • Boolean Helper
      • Multi Case Helper
      • Looper
      • FTP Helper
      • CSV Helper
      • XLSX Helper
      • Mail Sender
      • Flow Trigger
      • File Storage Helper
      • Terminate Helper
      • Delay Helper
      • SQL Connector
      • PDF Helper
      • Zip Helper
      • Data Warehouse Helper
      • XML Helper
      • Form Helper
      • Arrow
      • Error Arrow
    • Authentication Types Available
      • Setting up authentication
      • OAuth1
      • OAuth2
      • Refreshable token
      • AWS Signature
      • Basic Auth and Other Simple Authentication Methods
      • How are API versioning and API updates handeled?
      • Custom OAuth2 clients (apps)
    • Building Connectors
      • Base Connector Setup
        • Connector Auth Validation
        • GraphQL APIs
        • Rendering with User Input
      • Building Connector Actions
        • Actions Examples
      • Search Automation
      • Pagination Automation
      • Uploading Files in Actions
      • Working with SOAP APIs
    • Super Actions
    • Webhook Trigger for Connectors
    • Data Mapping and Env Variables
  • Embed - White Label Portal
    • Embed Overview
      • 1. Embed Flow
        • 1.1 Creating Embed Flows
        • 1.2 Updating Embed Flows
        • 1.3 Embed Error Handling
        • 1.4 Setting up Callbacks for Integration activation/deactivation
        • 1.5 Setting up Remote search
        • 1.6 Setting up End User logs
      • 2. Configure Embed
        • 2.1 Embed Integration via SSO
        • 2.2 Proprietary connector setup
        • 2.3 Sharing level
        • 2.4 Consent screen
        • 2.5 Account Secrets
        • 2.7 Further settings
      • 3. Integrate Embed
        • 3.1 iframe vs native embed
        • 3.2 Customizing CSS
        • 3.3 Events emitted from iframe to parent window
      • 4. Embed for End User
        • 4.1 Embed Remote Search
        • 4.2 Embed End User Logs
      • 5. Test Embed Configuration
        • Testing example
      • 6. Embed Integrations and Connector Auths
    • Embed FAQs
  • Data and Dashboards
    • Dashboards & Insights
      • Introduction to Dashboards
      • Introduction to Insights
      • Introduction to Data Sources
      • Dashboard Filters
      • Insight Marketplace - Using Pre-Built Insights
      • Writing SQL Queries
      • Useful SQL Examples
      • Charts
        • Line Chart
        • Bar and Horizontal Bar Chart
        • Stat Card
        • Pie Chart
        • Gauge Chart
        • Donut Chart
        • Stacked Bar, Horizontal Stacked Bar, and Normalized Horizontal Stacked Bar
        • Multiple Line Chart
        • Pivot Table
        • Map Chart
  • Best Practice Guides
    • Integration Best Practices
    • Integration Check List
    • CSV Files in Excel
    • Multi-Tenant Flows
    • On-Premise Integrations
    • Database Connection Setup
    • Data and General Security
    • Using Tags
    • FAQ
  • API
    • Locoia API Authentication - Personal Access Token
    • Create Connector Authentication
  • Contact us
  • Status of Service
  • Data Privacy
  • Imprint
Powered by GitBook
On this page
  • Flow setup
  • 1. Error handling and status logging
  • 2. Setting the errors list
  • 3. Setting the details list
  • 4. Setting the overview list
  • 5. Setting the combined list
  • Run Status

Was this helpful?

  1. Embed - White Label Portal
  2. Embed Overview
  3. 1. Embed Flow

1.6 Setting up End User logs

Give your end users more details about the integrations they have enabled.

Previous1.5 Setting up Remote searchNext2. Configure Embed

Last updated 4 months ago

Was this helpful?

Flow setup

To show the logs for an end user, the underlying Flows need to provide the necessary data in JSON format as the last step of the Flow in the following format (filled with example values, see the ):

{
  "overview": [
    {
      "status": "success",
      "number_of_records": 3
    },
    {
      "status": "error",
      "number_of_records": 5
    }
  ],
  "details": [
    {
      "entity": "unit",
      "status": "success",
      "number_of_records": 4
    },
    {
      "entity": "unit",
      "status": "error",
      "number_of_records": 4
    },
    {
      "entity": "building",
      "status": "success",
      "number_of_records": 3
    },
    {
      "entity": "building",
      "status": "error",
      "number_of_records": 1
    }
  ],
  "errors": [
    {
      "id": "1",
      "error": "Unit size missing",
      "entity": "unit",
      "internal_id": "2268dda0-a821-498e-ac7d-fcbef0e29fa9"
    },
    {
      "id": "2",
      "error": "Unit size missing",
      "entity": "unit",
      "internal_id": "8b34849c-b820-4be4-8b59-4407aa80134a"
    },
    {
      "id": "3",
      "error": "Unit category is missing",
      "entity": "unit",
      "internal_id": "798b9817-453a-40fa-abc9-1502814b6824"
    },
    {
      "id": "4",
      "error": "Unit size missing",
      "entity": "unit",
      "internal_id": "6ee52240-8f1a-4052-8bf7-5910064b2978"
    },
    {
      "id": "3",
      "error": "Building address is missing",
      "entity": "building",
      "internal_id": "5c0cb0b4-7bbe-4694-824c-cffe6e8ff4a"
    }
  ]
}

The overview view (1.) will be automatically generated without having to adjust the underlying Flows.

However, the # of successful and unsuccessful records will only be shown when setting up Flows as described.

Depending on your end users, it might make sense to write entity names in their local language instead of using the terms used by the API.

1. Error handling and status logging

Each upsert (or create/create) step in a Flow should use manual error handling and the error path should set a dictionary such as:

{
  "entity": "CORRESPONDING ENTITY",
  "status": "error",
  "internal_id": "{{ LOOP.id }}",
  "id": "{{ LOOP.reference }}",
  "error": "{{ UPSERT_STEP }}"
}

The id should be an ID that's familiar to the end user (e.g. a number shown in the UI of your system, instead of the internal ID used by the API. If applicable, both can be the same).

In case of success, a similar step (but with a different status) should be set, so that the results can later be easily summarized.

This part of the Flow would then for example look like this:

The same setup should be similar for other entities that are upserted.

2. Setting the errors list

SELECT
  internal_id,
  id,
  entity,
  error
FROM ENTITY_LOOP
WHERE
  status = 'error'
UNION ALL // If there are multiple loops for different 
SELECT
  internal_id,
  id,
  entity,
  error
FROM ENTITY_LOOP
WHERE
  status = 'error'
// Add more UNION ALLs in case there're more loops for different 

3. Setting the details list

SELECT
  entity,
  status,
  COUNT(*) AS number_of_records
FROM ENTITY_LOOP
GROUP BY
  status
UNION ALL // If there are multiple loops for different 
SELECT
  entity,
  status,
  COUNT(*) AS number_of_records
FROM ENTITY_LOOP
GROUP BY
  status
// Add more UNION ALLs in case there're more loops for different 

4. Setting the overview list

SELECT
  status,
  SUM(number_of_records) AS number_of_records
FROM DETAILS_LIST_QUERY_OUTPUT
GROUP BY
  status

5. Setting the combined list

Finally, all the lists are combined in the final step of the Flow:

{
  "overview": {{ OVERVIEW_LIST_QUERY_OUTPUT }},
  "details": {{ DETAILS_LIST_QUERY_OUTPUT }},
  "errors": {{ ERRORS_LIST_QUERY_OUTPUT }}
}

The end of the Flow would look similar to this:

The logic and format in the Flow can be freely defined (i.e. the examples shown above are just one possibility and might not apply to all Flows).

The only part that needs to be in the same structure as shown in the documentation is the final step of the Flow.

Run Status

The run status is set automatically, based on the following logic:

Status
Condition

Success

Error

If there's at least 1 error record and 0 success records specified in overview OR: If the Flow Run has status error

Finished

In cases where neither the Success nor Error conditions are fulfilled

Scheduled

The values for an end user will be displayed as specified (see ).

For common errors, it might make sense to validate records with a

After all steps of the Flow are finished, the results need to be summarized and transformed into the expected format. For that, it's easiest to use a , with the following SQL:

Similar to the , the Query Spreadsheet Action can be used:

Similar to the , the Query Spreadsheet Action can be used. This time, the should be the reference of the Action:

If there's at least 1 success record and 0 error records specified in overview OR: If the Flow Run has status success and the Flow is not

Future Flow Run (only if Flow has a )

example of the resulting logs
above
errors list
errors list
details output
Scheduler
properly setup
Spreadsheet Helper with the Query Spreadsheet Action
filter action