Skip to content

Conversation

@matyascimbulka
Copy link
Collaborator

@matyascimbulka matyascimbulka commented Sep 3, 2025

Links to this issue.

Improves the generation of the input props based on the input schema fetched from the Platform. When input field in the input schema doesn't have a default value the prefill value is used instead. Also all boolean fields are set to false unless changed by default or prefill setting.

@matyascimbulka matyascimbulka force-pushed the feat/2-prefill-values-from-input-schema branch from 5870118 to 4b64f79 Compare September 3, 2025 09:55
Copy link

@JanHranicky JanHranicky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, leaving a small comment 🤠, but approving! 🫡

Comment on lines 212 to 222
if (defaultValue) {
if (props[key].type !== "object") {
props[key].default = value.default;
props[key].default = defaultValue;

if (props[key].type === "string[]" && value.editor === "requestListSources") {
props[key].default = defaultValue.map((request) => request.url);
}
}

props[key].description += ` Default: \`${JSON.stringify(defaultValue)}\``;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this condition run for falsy values like 0 or false ?🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right. I think it would be better to check that the defaultValue isn't undefined.


if (value.default) {
props[key].description += ` Default: \`${JSON.stringify(value.default)}\``;
const defaultValue = value.default ?? value.prefill;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also wrote it into the issue
If the Actor has an input schema, let's use prefill values to prefill values in the form

I get that this is confusing, that in the Input Schema we called it prefill, but on the pipedream they call it default value, not sure if they have something like prefill.

The reson it that based on doc https://docs.apify.com/platform/actors/development/actor-definition/input-schema/specification/v1#prefill-vs-default-vs-required
the prefill is to guide the user on what to fill, what is exactly we wanted to do in the Run Actor action, get user idea , what to fill it by example.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that make sense.

@matyascimbulka matyascimbulka merged commit 168194a into master Sep 8, 2025
6 of 7 checks passed
@matyascimbulka matyascimbulka deleted the feat/2-prefill-values-from-input-schema branch September 8, 2025 13:31
matyascimbulka added a commit that referenced this pull request Sep 24, 2025
* feat(apify): Show list of built tags in actor run action

* feat(apify): Allow selecting actor search source for run Actor action and change how Actor or task name is displayed

* feat(apif): Remove wait for finish prop in run Actor action

* fix(apify): Fix PR issues

* fix(apif): Fix PR issues

* fix(scrape-single-url): return the only dataset item after the run is finished (#3)

* fix(scrape-single-url): return the only dataset item after the run is finished

* fix(scrape-single-url): version up

* fix(scrape-single-url): version up

* fix(scrape-single-url): version up

* fix(scrape-single-url): introduce a job status constant, expand a list of terminal statuses to stop the loop

* fix(scrape-single-url): import constants from package, decrease delay in between calls

* Migrate to use Apify client (#6)

* feat(apify): Replace Axios with Apify client

* fix(general): adding custom headers to client()=> preserve whole config to be passed to Axios later

* feat(general): add linter script

* fix(apify-get-dataset-items): a function for getting items and parsing of a result

* fix(apify-run-actor): working sync and async, dynamic input schema injection, KVS output retrieval tested only string

* fix(general): change maxResults for limit as an input field

* fix(run-task-sync): move items retrieval to the component, add waitSecs determined by input or plan to prevent blunt timeout error, have the item retrieval logic be connected to run status, clean return value

* fix(apify-scrape-single-url): incorporate timeouts, rework the whole API interaction logic

* fix(apify-set-key-value-store-record): detection of content type, fixed API interaction

* fix(apify-scrape-single-url): remove waiting timeout, return only dataset item, remove extra input fields connected to WCC run

* fix(apify-run-actor): success message

* fix(apify-run-task-synchronously): remove waiting for run to finish timeout

* fix(app): remove paidPlan input filed config

---------

Co-authored-by: Matyas Cimbulka <matyas.cimbulka@apify.com>

* fix(apify-get-dataset-items) 6: change input parameters (#8)

* chore(apify): Bump component versions

* chore: Sync upstream repo (#9)

* feat(apify): Prefill values from the input schema (#7)

* Revert "chore: Sync upstream repo (#9)"

This reverts commit cd804ba.

* Revert "chore(apify): Bump component versions"

This reverts commit 6040822 which for some reason bumped version of the wrong components.

* fix(apify): Fix build tag

* fix(apify): Address issues in run task synchronously action

* feat(apify): Add default crawler type to scrape single url

* fix(apify): Address issues from PR

* chore(apify): Change component versions

* fix(apify): Fix run Actor action

* fix(apify): Fix run get dataset items action

* fix(apify): Fix typos for PR

---------

Co-authored-by: Oleksandra Valko <oleksandra.valko@apify.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants