DeveloperTutorials for Web Developers & DesignersAdvanced

Bulk Update Scripts

As an Oncord developer, if necessary you can leverage the Oncord PHP API to run a script to bulk adjust data within an account.

Important: Executing the example scripts below could cause irreversible damage to the data within your Oncord account, so you should experiment with this code using a trial / test account, rather than an Oncord account that contains important data.

Create a Page & Form for your Script

To get started, create a new Page on the website. This page is usually offline, and hidden in navigation. As a standard, we usually create a new page called "_updatescript". 

With the page editor open, click SRC in the left sidebar, followed by the PHP tab. Any PHP code you write will execute as soon as the page is viewed publicly.

As a safer alternative, it's better practice to add a web form to the page which executes the PHP function containing the upgrade script, using the attribute onsuccessserver="yourfunction()". This approach prevents you from accidentally executing your PHP prematurely by viewing the page.

Add a form to the Page as HTML:

Open the PHP tab, and enter your code:

Some Example Scripts:

Update all contacts in a group, setting their home phone number to the value of their mobile number.

Bulk edit all child pages of a given parent page. Update the page content to change all instances of <h1> to <h2>.

Delete all Posts prior to 01-01-2017.

Bulk create recurring sales for specific contacts.

Update all groups, changing the values of a "Styles" custom field of data type combo box.