web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

Electronic Reporting - Problem with CONTAINS syntax in Payment Report

(0) ShareShare
ReportReport
Posted on by
Hi everyone. 
 
We're hoping someone may be able to advise of the correct syntax when using Contains in Electronic Reporting to find a range of values.
 
We are facing a challenge trying to get a Payment model report to return a different value based on the first character of a field, where that field may be any single digit.
 
The below syntax works:
 
IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/1/),/true/,/false/) 
 
-- If we Test using a value of 12345 we get /true/
-- If we Test using a value of 34567 we get /false/
 
What we need to do however is check if the first character of the field is any number 0-9, rather than specifically the number 1. We have tried several approaches including:
 
a) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/[0-9]/),true,false)
b) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/0-9/),true,false)
c) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/%0-9%/),true,false)
) IF(CONTAINS(Left(@.CreditorAccount.Identification.Number,1),/{0-9}/),true,false)
 
None of a to d work. They all return /false/ when testing, or a syntax error, no matter what number we put into the Test. I have checked the Learn documentation for Contains, but it's quite basic and haven't been able to find a more thorough ER syntax glossary. 
 
Is someone able to confirm the correct syntax for the /[0-9]/ section of the query please?
I have the same question (0)
  • Suggested answer
    Tony Staples Profile Picture
    19 on at
    Electronic Reporting - Problem with CONTAINS syntax in Payment Report
    I would suggest on using a different LOGICAL statement (such as 'VALUEIN'), CONTAINS is explicit so in your examples a-d none would apply.......
    ValueIn works in a similar fashion to OR statements!
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 650 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 582 Most Valuable Professional

#3
CU05031448-0 Profile Picture

CU05031448-0 526

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans