SOLVED - Calculated Field - Value from 2 Fields wether which one is filled

Hi,

so far i have a calculated field that takes a value from one field and uses it.

Formular:

subStr($stage_customer_postalcode_c,0,5)

But i'd like to adjust the field that it's possible to take the information needed from 2 fields.

And it depends on which field is filled with a value to take that value.

Usecase is:

We have Module A and Module B with records of Users.

In the Case Section we Link records from Module A or B, depending of the which kind of Users they are.

Within the Case Module we use the zipcode (at the moment just Module A) of the user for Reporting. So we see which ticket comes from which Region.

The Point is a calculated Field that will get it's value from either connected record form Module A or connected record from Module B.

I hope it's clear what i like to do

Parents
  • Hi Lennart Gebauer,

    I recently participated in this discussion that seems similar.

    The description is not clear as there are references to fields and related modules and some dependencies pertaining to those.

    Providing the database names and types of the fields, names of modules and relationships, all allow the community to better visualize the goal/use case for your inquiry and build/test something locally to ensure we're giving you an accurate and relevant response. I look forward to more details if the linked conversation does not address your need.

  • Jep,

    it was a Problem with the Relationship.

    The Cases Module needs an - N:1 - to the Module B

    So,

    if you have a Cases Module and you want to get Values from a connected record wether Module A or Module B or Module C, depending on which one is connected to Module Cases you need a Relationship ->

    Cases  - N:1 -  Module A/B/C

    After This you can generate a calculated field in the Cases Module with the following formula.

    ifElse(
    greaterThan(
    strlen(
    related($Module A,"Value from Module A")
    ),0),related($Module A,"Value from Module A"),ifElse(
    greaterThan(
    strlen(
    related($Module B,"Value from Module B")
    ),0),related($Module B,"Value from Module B"),ifElse(
    greaterThan(
    strlen(
    related($Module C,"Value from Module C")
    ),0),related($Module C,"Value from Module C"),"")))

    The field will show the Value of the Module that is connected to the Module Cases.

    I used this for ZipCodes therefore the fields are formatted as "floating-point-number"

    Hope it helps.
    Cheers

Reply
  • Jep,

    it was a Problem with the Relationship.

    The Cases Module needs an - N:1 - to the Module B

    So,

    if you have a Cases Module and you want to get Values from a connected record wether Module A or Module B or Module C, depending on which one is connected to Module Cases you need a Relationship ->

    Cases  - N:1 -  Module A/B/C

    After This you can generate a calculated field in the Cases Module with the following formula.

    ifElse(
    greaterThan(
    strlen(
    related($Module A,"Value from Module A")
    ),0),related($Module A,"Value from Module A"),ifElse(
    greaterThan(
    strlen(
    related($Module B,"Value from Module B")
    ),0),related($Module B,"Value from Module B"),ifElse(
    greaterThan(
    strlen(
    related($Module C,"Value from Module C")
    ),0),related($Module C,"Value from Module C"),"")))

    The field will show the Value of the Module that is connected to the Module Cases.

    I used this for ZipCodes therefore the fields are formatted as "floating-point-number"

    Hope it helps.
    Cheers

Children
No Data