I’m trying to create a Power Flow which creates two strings [Opportunity Name] and [Opportunity ID] for a sales pipeline list on SharePoint. The flow also sends the item creator an email with the Opportunity Name & ID for reference. My Flow fails and I’m unable to determine why.
Basic Flow Logic
1) When a new list item is created trigger flow
2) Initialize variable (varTEXT_OpyID): Concataion of string "OPY_" and Curremt Item [ID]
3) Initialize variable (varTXT_OppName): Concataion of Item fields i.e. [CountryorRegion] & '_' & ['Location'] & '_' & ['DealSize'] & ['CapacityUnits'] & '_' & ['CodeName']
4) Update current item with "varTXT_OppName", "varTEXT_OpyID" .... other fields.
5) Get [Created By] profile, name, email etc.
6) Send email to [Created By] which include reference to item fields and flow variables
Issue:
Error message:
Unable to process template language expressions in action 'Initialize_var_-Create_Op_Name_String' inputs at line '1' and column '3011': 'The provided parameters for template language function 'trim' are not valid.'.
The failed variable expression is as follows:
concat
(
trim(triggerBody()?['CountryorRegion']?['Value'])
,'_'
,trim(triggerBody()?['Location'])
,'_'
,trim(triggerBody()?['DealSize'])
,trim(triggerBody()?['CapacityUnits']?['Value'])
,'_'
,trim(triggerBody()?['CodeName'])
)
)
Grateful for your help in resolving the issue.
Flow Steps
Error Step
Solved! Go to Solution.
Thank you for the hint. The issue was one of my concatenated fields was an integer. Which made the trim() function throw an error.
I used formatNumber(<number>, <format>, <locale>) function to handle the integer and then wrapped it in a trim(). As Follows: trim(formatNumber(triggerBody()?['DealSize'],'F','en-gb'))
Function Reference:
e.g.
concat
(
trim(triggerBody()?['CountryorRegion']?['Value'])
,'_'
,trim(triggerBody()?['Location'])
,'_'
,trim(formatNumber(triggerBody()?['DealSize'],'F','en-gb'))
,trim(triggerBody()?['CapacityUnits']?['Value'])
,'_'
,trim(triggerBody()?['CodeName'])
)
)
can you try adding a compose data operation on the below expression only for troubleshooting
trim(triggerBody()?['CountryorRegion']?['Value'])
Just guess that the input to the trim function here is an integer rather than a string
Thank you for the hint. The issue was one of my concatenated fields was an integer. Which made the trim() function throw an error.
I used formatNumber(<number>, <format>, <locale>) function to handle the integer and then wrapped it in a trim(). As Follows: trim(formatNumber(triggerBody()?['DealSize'],'F','en-gb'))
Function Reference:
e.g.
concat
(
trim(triggerBody()?['CountryorRegion']?['Value'])
,'_'
,trim(triggerBody()?['Location'])
,'_'
,trim(formatNumber(triggerBody()?['DealSize'],'F','en-gb'))
,trim(triggerBody()?['CapacityUnits']?['Value'])
,'_'
,trim(triggerBody()?['CodeName'])
)
)
User | Count |
---|---|
5 | |
5 | |
4 | |
2 | |
2 |