Advanced tips: How to find blocks across multiple Omniscope projects

Modified on Tue, 29 Jul at 5:05 PM

Introduction


In this tutorial, we'll walk through creating a project that lists all the blocks across your Omniscope projects. We'll then refine this to filter blocks by type, such as custom blocks.


Step 1: Start with Project Metadata


Let's begin with a blank project and add a Project metadata block. This block allows you to select an Omniscope project file and emits four datasets:


  • Blocks
  • Reports
  • Report tabs
  • Report field usages


Select the path to a project - in this example Cleanup Customer Survey Address Data.iox.



Execute the block, then open the Data tab and select the Blocks sub-tab. You'll see a list of blocks in that project, and metadata including the name of the block and type (e.g. Custom, File, Field Organiser).



This gives us block data for a single project, but we want to list blocks from all projects inside a folder. For that, we'll use the For each block


Step 2: Prepare the For Each block


The For each block iterates through a dataset, executing an upstream workflow for each iteration and appending the results. It requires:

  • Workflow input: the upstream logic (our Project Metadata block)
  • Iteration data input: a dataset with parameter names and values.


Before we can use this block we need two things:

  1. A parameter that to set the project path.
  2. A list of project paths to iterate over


Step 2a: Create a project path parameter.


Click the 3-dot menu, select Parameters and add a new parameter. Lets call this project path. Set the Type to File path and enter a sample value to test.



Now, update your Project Metadata block to use this parameter instead of the fixed file path.



Step 2b: Generate Iteration data


To generate the list of IOX projects, add a File attribute block. Open the block and point it to the folder containing your projects. Filter for IOX files only.



Execute the block. In the Data tab, you'll see file details including path and extension.



Next, add a Field organiser block to tidy the data:


  • Delete all fields except Full path.
  • Rename Full path to Project path (matching the parameter name)


Next, we will use a Field organiser block to prepare this data for the For each block:


  • Delete all the fields except for Full path.
  • Rename the Full path field to project path (the same name as our parameter).



You now have a dataset with a single field, ready to feed into the For each block.


Step 3: Connect and run the For each block


Add a For each block and connect:


  • Project metadata block -> Workflow input
  • Field organiser block -> Iteration input



Execute the workflow. Open the Data tab in the For each block to view metadata for all blocks across all projects, including project path and block name.



Optional step: Filter by block type


To focus on specific block types (e.g. custom blocks, add a Record Filter block after the project metadata block. Add a filter rule: Type = Custom.



Re-execute the workflow. You'll now see only the custom blocks across the selected projects.



In this example we found six custom blocks across three different IOX files. For example, in Cleanup Custom Survey Address Data.iox, we see three custom blocks:


  • Classify Postcodes 2
  • Extract Address Parts 2
  • Merge 2



If you open this project, you'll find those exact custom blocks in the workflow.



Optional step: Track fixes and assignments


If you're identifying blocks for maintenance (e.g. updating Python dependencies in your custom blocks), you can track your progress using a checklist.


Add a Data Table block and fill with data from the last Field Organiser block. Add additional fields such as:


  • Assignee
  • Fixed (Yes/No)


Connect this to a report and add an Editable table view, so your team can log updates and collaborate on the fixes.







Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article