AMID a slew of fairly bleak economic indicators for Scotland and the UK as a whole, which reflect the growing impact of the Brexit vote, news this week of record foreign direct investment north of the Border was most welcome.

Accountancy firm EY’s annual survey shows Scotland won a record number of foreign direct investment projects last year. This is impressive, given 2015 had seen a 51 per cent leap in the number of such projects attracted.

Scotland secured 122 foreign direct investment projects in 2016, up by 2.5 per cent from 119 in 2015.

EY noted “Scotland has secured the UK’s second-highest number of projects in every one of the past five years”, trailing only London. This is no mean feat, particularly given the Conservative Government’s determination to be seen to be boosting the north of England through its “Powerhouse” project.

It was interesting to hear Mark Harvey, senior partner in Scotland for EY, make it plain he saw no effect in the survey from renewed debate over a second Scottish independence referendum in the wake of last June’s vote by the UK electorate to leave the European Union.

He said: “I think it is more Brexit that is relevant at this stage.”

Of course, in these days of Scottish constitutional debate, inward investment seems to have become much more of a political football than in the past. So we should perhaps not be surprised that this week’s record inward investment figures for Scotland from EY did appear to have some detractors.

Some seemed at pains to seize upon the fact the number of new jobs associated with inward investment projects won by Scotland had fallen sharply, from 5,385 in 2015 to 2,868 last year, or from a rounded 45 to 24 per project on average. This is an interesting, and valid, point for debate.

For his part, Mr Harvey highlighted a need to look beyond the job numbers to the types of roles being created.

He said: “There is clearly a challenge around the number of jobs that are coming per project .”

However, citing the creation of jobs in the likes of research and development, and life sciences, he added: “Our view around that is, if you look at the sectors [in which] the jobs are being created, these are good-quality jobs coming to Scotland, so we should look at the quality as well as the quantity of jobs.”

It would surely be difficult to take issue with this point. Quality is crucial.

Back in the 1990s, there seemed to be a perception in some quarters, rightly or wrongly, that there was too much of a focus on the number, rather than the type, of jobs coming with inward investment projects. Specifically, there was great worry about the huge numbers of call centre jobs coming into Scotland, particularly at a time when the growth of the internet cast doubt on the sustainability of some of these roles.

The call centre wave followed Scotland’s successes over decades in winning inward investment projects from major overseas electronics manufacturers. The vast bulk of these large-scale electronics manufacturing plants, which brought with them huge numbers of jobs, have since been closed.

These closures have resulted in massive job losses, and have been a bitter blow to many communities.

That is not to say that these now-closed electronics plants did not provide crucial employment for very large numbers of people for decades.

However, it is important to recognise the world has moved on. Large-scale electronics manufacturing has shifted to lower-cost economies, and it is unlikely to return. And if Scotland’s experience of the arrivals and closures of huge electronics plants has taught us anything, it is that the country needs to move up the value chain.

Public policy in Scotland has taken this need on board, both under SNP and previous Labour-led administrations, and this week’s EY survey appears to signal considerable successes on this front. As always, we should not forget the efforts of taxpayer-funded Scottish Development International, which continues to play a crucial role in enabling the country to punch above its weight on the global stage in winning inward investment.

The fact of the matter is that the likes of sophisticated research and development projects in technology-focused sectors, such as software or life sciences, will bring with them fewer jobs than electronics mass manufacturing.

Mr Harvey described Scotland’s success in attracting technology, life sciences and software projects from overseas last year as “quite a powerful message to get across from the data”.

From a Scottish perspective, there does appear to be one major cloud on the inward investment horizon.

However, as with the depressing impact of ill-judged Conservative austerity on the Scottish economy, this cloud was not formed here.

The cloud, of course, is Brexit.

Mr Harvey highlighted the apparent impact of Brexit on overseas investors’ perceptions of the UK. About 31 per cent of overseas investors surveyed predict the UK’s attractiveness will decline. This is up from just eight per cent in the previous annual survey.

Mr Harvey noted overseas investors had flagged concerns over issues such as future UK access to the European market and to global trade deals, as well as to skills. These are undoubtedly key factors in investment decisions.

Employees from fellow EU member states and other overseas countries form a crucial part of the workforce in Scotland and elsewhere in the UK. Yesterday, the Institute of Directors described a rise in the number of people from other EU member states leaving the UK, revealed in official figures, as an “alarming sign for business”.

And, if an investor from outwith the EU is looking for a base from which to sell into the huge single European market, why would the UK be anywhere near top of its list at the moment?

If Scotland is to continue to set records for inward investment in coming years, whatever its constitutional position, free access to the EU market and an ability to retain and recruit the overseas workers it needs will be vital ingredients.