Column to store 100 Phone Numbers

Hi Experts,

I have a requirement where I need to store 100 phone numbers in a given field, i.e Targets for now. And then to filter the data on all the columns considering if user searches with 555 then 2nd record should be returned

Currently I was using a single table with structure as shown below

TargetID (num) OrderID (num) Targets(varchar)
1 1 +91-9999999999
+91-9999999999
+91-8888888888
2 1 +91-9999999999
+91-9999999999
+91-8888888888
+91-5555555555

Now, due to some performance issues, we need to get that targets column to be moved to a separate table and store all the phone numbers as a separate row, as shown in below tables

TargetID OrderID
1 1
2 1

id TargetID Targets
1 1 +91-9999999999
2 1 +91-9999999999
3 1 +91-8888888888
4 2 +91-9999999999
5 2 +91-9999999999
6 2 +91-8888888888
7 2 +91-5555555555

Kindly suggest as how this can be implement, do we need to use nested CDT or if there is any other way possible.

Thanks,

Gaurav Singh

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    This is a good idea. Do not store multiple values in a single field.

    For the design of the data model, I suggest to follow these guidelines

    docs.appian.com/.../data-modeling-with-appian-records.html

  • Hi Stefan,
    Thanks for your response, The above guideline will lead us to redesign the whole process.


    Currently we are using the CDT for target with below structure.

    {
    'type!{urn:com:appian:types:TEST}TEST_Target'(

    targetID:" ",

    'orderID': 1,

    'targets': "123;3422;23443",

    'searchDate': fn!datetime(2023, 2, 18, 0, 0, 0, 0)

    )
    }

    How can we redesign this so that 'targets' column could be array of cdt itself like as shown below.

    {

    'type!{urn:com:appian:types:TEST}TEST_Target'(

    targetID:" ",

    'orderID': 1,

    'targets': {

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "123" ),

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "3422" ),

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "23443" )

    }

    'searchDate': fn!datetime(2023, 2, 18, 0, 0, 0, 0)

    )

    }

Reply
  • Hi Stefan,
    Thanks for your response, The above guideline will lead us to redesign the whole process.


    Currently we are using the CDT for target with below structure.

    {
    'type!{urn:com:appian:types:TEST}TEST_Target'(

    targetID:" ",

    'orderID': 1,

    'targets': "123;3422;23443",

    'searchDate': fn!datetime(2023, 2, 18, 0, 0, 0, 0)

    )
    }

    How can we redesign this so that 'targets' column could be array of cdt itself like as shown below.

    {

    'type!{urn:com:appian:types:TEST}TEST_Target'(

    targetID:" ",

    'orderID': 1,

    'targets': {

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "123" ),

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "3422" ),

    'type!{urn:com:appian:types:TEST}Test_RelatedTargets'( targetID:' ', 'Target': "23443" )

    }

    'searchDate': fn!datetime(2023, 2, 18, 0, 0, 0, 0)

    )

    }

Children