List structure

Country-Single line of text
customer-Single line of Text
Incoming Email details

Flow details


toLower(triggerOutputs()?['body/subject']) contains toLower('Country')
toLower(triggerOutputs()?['body/subject']) contains toLower('Customer')

json(concat('{ "', replace(replace(triggerOutputs()?['body/subject'],':','" : "'),'\','", "'),'" }'))
outputs('Subjectextract')['Country']
outputs('Subjectextract')['Customer']



CReate folder expression
formatDateTime(utcNow(), 'yyyy')
create month folder expression
concat(formatDateTime(utcNow(), 'yyyy'),'/',formatDateTime(utcNow(), 'MMMM'))
set country variable expression
split(outputs('Subjectextract')[0],': ')
set customer variable
split(outputs('Subjectextract')[1],': ')

create new folder till country expression
concat(formatDateTime(utcNow(), 'yyyy'),'/',formatDateTime(utcNow(), 'MMMM'),'/',variables('varcountry'))
create new folder till customer expression
concat(formatDateTime(utcNow(), 'yyyy'),'/',formatDateTime(utcNow(), 'MMMM'),'/',variables('varcountry'),'/',variables('varcustomer'))
create new folder finalpath expression
concat(formatDateTime(utcNow(), 'yyyy'), '/', formatDateTime(utcNow(), 'MMMM'), '/', variables('varcountry'), '/',variables('varcustomer'))


output of ‘Subjectextract’ is json but im not aware of onverting into array because i need to create folder based on these values array index then i need to use split inorder to create an array index and concat values and create folder structure in document library as per above flow but my above flow failed with this error
Unable to process template language expressions in action 'Set_Country_variable' inputs at line '0' and column '0': 'The template language expression 'split(outputs('Subjectextract')[0],': ')' cannot be evaluated because property '0' cannot be selected.

Run error for my above flow logic
I am trying to extract subject values when new email arrives and create items in list additionally adding email attachment in document library with year\month\country\customer folder inorder to place email attachments


