API Data Source running twice

The problem I have is that a dmx-api-datasource is processing twice. It is a simple API Data Source linking to a PHP file in the same directory. It simply creates a PDF file as shown in the last screenshot. The funny thing is that both PDFs are exactly the same apart from the first one if missing part of the filename which is returned from the first SC.

	<dmx-serverconnect id="sc_create_PDF_from_job_id" url="../dmxConnect/api/Reports/sa_create_PDF_from_job_id.php" dmx-param:job_id="query.job_id"></dmx-serverconnect>
	<dmx-serverconnect id="sc_create_PDF_imgs" url="../dmxConnect/api/Reports/sa_create_PDF_imgs.php" dmx-param:job_id="query.job_id"></dmx-serverconnect>
	<dmx-api-datasource id="api1" is="dmx-fetch" dmx-param:dirname="'pdf_template_AD_Report.php'" dmx-param:output="'repository/' + query.job_id + '/' + query.job_id + '_' + sc_create_PDF_from_job_id.data.q_create_PDF_from_job_id.index + '_AD_Report.pdf'" url="pdf_generate.php" dmx-param:job_id="query.job_id"></dmx-api-datasource>

The two dmx-serverconnects and the first of the dmx-api-datasource process together. Then, when they have completed the dmx-api-datasource processes again but this time with the result of

sc_create_PDF_from_job_id.data.q_create_PDF_from_job_id.index

being returned and included (it is missing in the first process).

image

Can anyone give me a clue as to why ‘pdf_generate.php’ might be running twice?

This has been happening for quite some time and so is not related to version changes.
Current set-up : SPA Pages, Windows 10, MySQL, PHP

EDIT:
I don’t know why this might help, but could it be something to do with “index”?
Is “index” a reserved word?
In my case, Index is the index registration number of a car and not the $index of the returned query.

Community Page
Last updated: