Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

Bring a specific character of a string of characters in Electronic Reporting

(0) ShareShare
ReportReport
Posted on by 40

Hi everyone
I need to do something in Electronic Reporting using formulas but I need some help because I'm having a hard time doing this.
I am trying to recover a character using a specific character as a parameter ina character string.
Ok, I will try to demonstrate it.
In a a specific text field of D365FO I have the information "654321-0".
In the model mapping I only needs to bring the characters that are after the character "-".
Is it possible to do that in using formula in Electronic Reporting?
Thanks to advance

  • Eric_Santos Profile Picture
    Eric_Santos 40 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Sorry. That's the correctly formula:

    IF(CONTAINS(Doc_fiscal.'find()'.ThirdPartyCCMNum,"-"), RIGHT(Doc_fiscal.'find()'.ThirdPartyCCMNum, 1), "")

  • Eric_Santos Profile Picture
    Eric_Santos 40 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi, Alireza.

    Thank you so much man. You helped me a lot. I needed to change a little bit your formula but you was right. It's worked. Below is the formula that I used in my ER model mapping.

    IF(CONTAINS(Doc_fiscal.'find()'.ThirdPartyCCMNum,"-"), RIGHT(Doc_fiscal.'find()'.ThirdPartyCCMNum, 1

    One more time, thank you so much, Alireza.

  • Verified answer
    Alireza Eshaghzadeh Profile Picture
    Alireza Eshaghzadeh 12,550 Super User 2024 Season 2 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Eric,

    Thanks for the clarification.

    Then you can use combination of 1-IF 2-Contain 3-RIGHT functions as follows:

    IF(

    CONTAINS(parameter, "-"),

    RIGHT(parameter,1),

    "")

    Or 1-IF 2-Contain 3-MID functions as follows

    IF(CONTAINS(parameter, "-"),

    MID(parameter,8,5),

    "")

    It will check and if it finds "-" on the Governmental number it will use RIGHT or MID functions, if not it will use "" (Blank).

    I hope it helps you.

  • Eric_Santos Profile Picture
    Eric_Santos 40 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Alireza.

    Sure.

    Example:

    I have a text field in the vendor account. in this field I need to fill a specific governmental code of the vendor. For some cases this number has a check digit separated by a hyfen. In some cases this number don't has this check digit. In ER I am building a report that retrieves this number and its possible check digit. If the governmental number provided by vendor has a check digit I need to fill it in a specific field of the report. If don't this field on the report needs to leaves in blank.

    Example with check digit.

    Governmental number: 654321-0

    Field on ER: "0"

    Example without check digit.

    Governmental number: 6543210

    Field on ER: ""

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    Alireza Eshaghzadeh 12,550 Super User 2024 Season 2 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Eric,

    Can you elaborate with some examples especially what should be upcoming result in ER?

  • Eric_Santos Profile Picture
    Eric_Santos 40 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hello, Alireza.

    Thanks for your reply. I need to apologize with you to. As I said to Judy above I didn't explain my scenario correctly.

    The information on this field is not standardized. This is a governmental data and depends of the vendor location. Depending of the city where it is located this number can change of the format. In some cases this number will have a check digit like the format that I passed before (654321-0). In other cases this number wont have this check digit (654321).

    So, in ER, in a specific field of the reporting I need to fill only the check digit if it exists. If don't this field needs to be leave in blank.

    What I need is a way that attends the both cases with and without the check digit.

    That is the reason that I would like to use the character "-" as a parameter. Because if the number filled on the field has the check digit it must have the character "-". Otherwise it wont have this character.

    Thanks for your help

  • Eric_Santos Profile Picture
    Eric_Santos 40 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Judy.

    Thanks for your answer.

    I need to apologize because I think that I didn't explain the whole scenario.

    The information on this field is not standardized. This is a governmental data and depends of the vendor location. Depending of the city where it is located this number can change of the format. In some cases this number will have a check digit like the format that I passed before (654321-0). In other cases this number wont have this check digit (654321).

    So, in ER, in a specific field of the reporting I need to fill only the check digit if it exists. If don't this field needs to be leave in blank.

    What I need is a way that attends the both cases with and without the check digit. That is the reason that I would like to use the character "-" as a parameter. Because if the number filled on the field has the check digit it must have the character "-". Otherwise it wont have this character.

    I hope I could to explain better now.

  • Suggested answer
    Alireza Eshaghzadeh Profile Picture
    Alireza Eshaghzadeh 12,550 Super User 2024 Season 2 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Eric,

    It is possible.

    If your information is fixed with the provided format (i.e. 654321-0). You can try with Right formula - RIGHT(parameter,1). Then the result will be " 0 " .

    Or if the "-" as 7 character in your field, you can use MID formula. MID(parameter,8,5)

    Example: 654321-912

    Result: 912

  • Suggested answer
    huijij Profile Picture
    huijij 19,811 on at
    RE: Bring a specific character of a string of characters in Electronic Reporting

    Hi Eric_Santos,

    Please refer to the RIGHT ER function which returns a String value that presents the specified number of characters from the end of the specified string:

    docs.microsoft.com/.../er-functions-text-right

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans