Skip to main content

Notifications

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?
  • Suggested answer
    Tony Staples Profile Picture
    Tony Staples 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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,842 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans