Transform a list of a certain data type to a list of another data type

Hi everyone,
I’ve got a list of images. I want to add to every image a yes/no field, so I created a data type which I called iws (which stands for “image with signal”).
So, I’m populating a repeating group with a list of iwss. The list is a custom state on the page (datatype = list of iws.
I got stuck at the on page load workflow at the first step , because I can’t figure out how to build a list of iws starting from a list of image. Is there a way to create an instance of a custom data type from scratch by setting it up field by field, or by enriching a list of items?

The closest I can think of is Schedule API Workflow on a list, where each API workflow instance will receive one item in the list, so it can create a record based on the item.

Other ways of creating new records dynamically are:

  • A loop in Javascript to trigger page workflows
  • Data API Bulk create
  • Recursive API Workflow
  • Calling custom events multiple times

There are also ways to create new records on a once-off basis:

  • Import from CSV

You may want to consider creating the other record at the same time as the original is created.

I can’t use an API workflow because this is a thing related to an UI operation and must happen instantly, without waiting for an external server to respond.

1 Like

Schedule the API workflow to “current time” and it will happen as live as possible. It won’t process the entire list instantly, but will do it.

Or you can do it before the user needs to see it, so when the user arrives things will already be done. This is the ideal in some cases.

In general, an API Workflow should work, albeit asynchronously.
I don’t want to sound too picky, but as far as I understood, API Workflows can’t access custom states, so I’m forced to do read and writes to the database, which is going to add a considerable delay when used in a UI workflow.
I will investigate if I can do that through a custom event, I just discovered them a few hours ago.

This topic was automatically closed after 70 days. New replies are no longer allowed.