VOOZH about

URL: https://apify.com/drobnikj/keboola-input-mapping

⇱ Keboola Input Mapping Β· Apify


Pricing

Pay per usage

Go to Apify Store

Keboola Input Mapping

It parses the input table from Apify <> Keboola extractor and maps the data into another task or actor input.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

πŸ‘ Jakub DrobnΓ­k

Jakub DrobnΓ­k

Maintained by Community

Actor stats

4

Bookmarked

25

Total users

2

Monthly active users

a year ago

Last modified

Share

This Actor parses the input table from the Apify <> Keboola extractor and maps the data into another task or Actor input. If you haven't used the Apify <> Keboola integration yet, this tool is probably not what you're looking for, and you should read this article to learn more about the integration.

Introduction

It is not possible to pass the input table from the Keboola extractor into any public Actor because the Keboola extractor passes the input table using a key-value store. The storeId and key of the input table are put into the Actor/task input. Since storeId and key are not part of any public Actor, they will be omitted. This tool helps you run an Actor/task from the Keboola extractor and map the input table into Actor/task input.

Setup

The recommended way to use it is to create a task out of this Actor and predefine the target task or Actor you need to run, along with the input mapping function.

πŸ‘ img.png

Afterward, you can easily run this task from Keboola using the Apify component and the "Run task" action on the Keboola platform.

πŸ‘ img.png

With this setup, you will run the component on Keboola with Input Table data, and the data will be passed to the target Actor or task based on the mapping function. When the target task or Actor finishes, you will receive data in the Keboola platform.

Input Configuration

The following configuration settings can be entered manually in the Apify Console or programmatically via a JSON object using the Apify API. Below is a summary of the input fields:

Target Actor or Task

Specifies the Actor or task to run.

Input Mapping

The JavaScript function that maps the data from Keboola into the input for the target task or Actor. The function has two parameters:

parsedInputTableCsv

The data parsed from the Keboola Input Table in array format. The array will have items as objects where each object will have properties based on columns.

Title,URL
Test1,http://example.com#1
Test2,http://example.com#2

will transform into:

[
{
"Title":"Test1",
"URL":"http://example.com#1"
},
{
"Title":"Test2",
"URL":"http://example.com#2"
}
]

originalInput

This parameter holds the original input from Input Overrides from Keboola platform settings for task runs.

Output Mapping

The JavaScript function maps the output (dataset items) from the target task or Actor to the output format for the Keboola platform.

Note: The function can return a single object or an array of objects. If the function returns an array, each object will be saved as a separate row in the output dataset.

The function has one parameter:

item

An item from the dataset output of the target task or Actor.

Skip Metamorph

If set to true, Metamorph will not be used in processing. This option should only be enabled in specific cases where Metamorph cannot be utilized, as it may increase resource consumption.

Note: If the output mapping function is enabled, the metamorf wil be always skip.

Use Case - Web Scraper

Imagine we have tabular data in a CSV in Keboola in the following format:

Title,URL,ID
Test1,http://example.com#1,product_1
Test2,http://example.com#2,product_2
Test3,http://example.com#3,product_3
Test4,http://example.com#4,product_4
Test5,http://example.com#5,product_5

The input for the input mapping task will be:

Target Actor ID: apify/web-scraper

Input Mapping Function:

functioninputMappingFunction({ originalInput, parsedInputTableCsv }){
const startUrls = parsedInputTableCsv.map((line)=>{
return{url: line['URL']};
});
return{
startUrls,
};
}

This function will map the input table from Keboola into the start URLs input for the Web Scraper Actor.

We will save the task, go to Keboola, use the created task in Apify extractor, and select the table we want to pass.

πŸ‘ Keboola-ex

After we save and run this configuration, the task should execute our target task and use the input created in the mapping function.

Use Case - Google Maps Review Scraper

Imagine we have tabular data in a CSV in Keboola in the following format:

Title,URL
Restaurant one,https://www.google.com/maps/place/?q=place_id:ChIJjXrFkantkIgRWkqwctFznKk
Restaurant two,https://www.google.com/maps/place/?q=place_id:JuIljXrFkantkIsrWkqwctFzjjk

Additionally, we need to get only reviews newer than January 1, 2024, reviews in English, and limit reviews to a maximum of 100.

The input for the input mapping task will be:

Target Actor ID: compass/Google-Maps-Reviews-Scraper

Input Mapping Function:

functioninputMappingFunction({ originalInput, parsedInputTableCsv }){
const startUrls = parsedInputTableCsv.map((line)=>{
return{url: line['URL']};
});
return{
startUrls,
reviewsStartDate: originalInput.reviewsStartDate,
language: originalInput.language,
maxReviews: originalInput.maxReviews,
};
}

This function will map the input table from Keboola into the start URLs input for the Google Maps Review Scraper Actor, plus it will pass input overrides for the reviews start date, language, and maximum reviews to the target Actor.

We will save the task, go to Keboola, use the created task in Apify extractor, and select the table we want to pass.

πŸ‘ Keboola-ex

After we save and run this configuration, the task should execute our target task and use the input created in the mapping function.

Miscellaneous

If you're struggling with your Apify <> Keboola setup, please ask me for help or contact Apify support.

You might also like

Keboola Uploader

hckr-studio/keboola-uploader

Reliable uploader of Apify Datasets to Keboola Connection (aka KBC). Integration-ready.

Keboola Uploader

hlidac-shopu/keboola-uploader

Reliable uploader of Apify Datasets to Keboola Connection (aka KBC). Integration-ready. Supports development of non-profit service https://www.hlidacshopu.cz/

πŸ‘ User avatar

Hlídač shopů

3

Forward Dataset to Actor or Task

valek.josef/forward-dataset-to-actor-or-task

Forwards contents of specified dataset to a specified field on the input of another Actor or task.

πŸ‘ User avatar

Josef VΓ‘lek

22

Dynamic Input

useful-tools/dynamic-input

Actor for calling other Actors with dynamic input

26

Example Secret Input

apify/example-secret-input

This Apify actor showcases how to use secret fields in the actor input.

Price Drop Tracker - Monitor Any E-commerce Product

alizarin_refrigerator-owner/price-drop-tracker---monitor-any-e-commerce-product

Actor for scraping data from a single web page. The URL of the web page is passed in via input, defined by the input schema. It uses the Axios client to get the HTML of the page & the Cheerio library to parse the data from it. The data are then stored in a dataset where you can easily access them.

Keboola Igniter

hckr-studio/keboola-igniter

This actor helps start asynchronous workflow on Apify platform. It's useful when you have long running scrapes and don't want to pay just for waiting for completion.

Related articles

Instagram location scraping: complete guide
Read more
How to build and monetize an AI agent on Apify
Read more
How to track competitor ads and prices on Meta with Apify and n8n
Read more