Write to MDSE with conditions

Hi All,

I have a scenario where I need to write data to multiple tables under single entity.

So I thought of using wmdse

But there s no guarantee that Everytime the data will be there to write in all the mutilple tables which I am planning to write.

So based on condition how can I load the input entity data set and how can I save the stored values into respective cdt data pvs?

TiA

Harsha

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Harsha,

    As per my experience with Write to Multiple Data Store Entity, when the value of your data attribute is empty i.e. {} then appian do not store anything into DB. e.g:

    {
      a!entityData(
        entity: cons!FIRST_DATA_STORE_ENTITY,
        data: {}
      ),
      a!entityData(
        entity: cons!SECOND_DATA_STORE_ENTITY,
        data: type!MY_CDT(
          id: 1,
          name: "test"
        )
      )
    }

    As shown in above code snippet, there will be a transaction to store the data into the entity mapped with SECOND_DATA_STORE_ENTITY constant, whereas another will be skipped as it's data is empty. Hence you need to form the EntityData in the similar way to be used in Write to Multiple Data Store Entity Smart Service.

    Also, it's worth checking this link.

    Hope this will help.

Reply
  • 0
    Certified Lead Developer

    Hi Harsha,

    As per my experience with Write to Multiple Data Store Entity, when the value of your data attribute is empty i.e. {} then appian do not store anything into DB. e.g:

    {
      a!entityData(
        entity: cons!FIRST_DATA_STORE_ENTITY,
        data: {}
      ),
      a!entityData(
        entity: cons!SECOND_DATA_STORE_ENTITY,
        data: type!MY_CDT(
          id: 1,
          name: "test"
        )
      )
    }

    As shown in above code snippet, there will be a transaction to store the data into the entity mapped with SECOND_DATA_STORE_ENTITY constant, whereas another will be skipped as it's data is empty. Hence you need to form the EntityData in the similar way to be used in Write to Multiple Data Store Entity Smart Service.

    Also, it's worth checking this link.

    Hope this will help.

Children
No Data