here is Copilot text to show what my flow is doing .
his flow is triggered when a new email is received from "x@x.x" with any importance. It checks if the email contains attachments and if the attachment name starts with "Facture". If the email body contains "ANP-DAKHLA" and does not contain "REGLEE", it creates a file in the "/Documents/factures ANP/dakhla" folder. If the email body contains "TANTAN" and the attachment name starts with "Facture", it creates a file in the "/Documents/factures ANP/tantan" folder. If the email body contains "ANP-LAAYOUNE" and the attachment name starts with "Facture", it creates a file in the "/Documents/factures ANP/laayoune" folder.
So my request is to change attachment name into the numbers in the email body that follows the sentence XXX
each time i try i get error : Le ou les paramètres d'entrée de l'opération « for_each » contiennent une ou plusieurs expressions non valides. Corrigez la ou les expressions non valides pour le ou les paramètres d'entrée de l'opération « for_each ».
in create file : file name : @substring(triggerOutputs?['body']?['body'],add(indexOf(triggerOutputs?['body']?['body'],'Facture numero :'),16),8)