In my previous article, I explained the Sequence function. In this article, let’s see how to generate test data and bind it to a gallery control in no time.

Steps to prepare test data:
- Create a simple canvas app with a Button, Textinput (i.e.,txtDataCount) and Gallery controls.
- On ‘OnSelect’ event of button, place following formula:
- This formula generates the customer objects using the Sequence function and adds them to collTestCustomers collection.
- No of customers depends on the value provided in ‘txtDataCount‘ TextInput field.
ClearCollect(
collTestCustomers,
ForAll(
Sequence(txtDataCount.Text),
{
customerName: "Customer " & Value,
customerCity: "City " & Value
}
)
);

- Set the gallery ‘Items’ as collTestCustomers.

- That’s it!. Run the App.

🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment