Skip to main content

I’m trying to build a process flow that would copy a field into 2 other fields elsewhere in the application upon an event. The string that I am copying is a varchar(2000), one of fields I am copying it into is varchar(200) and the other is varchar(2000).  So what I’m trying to accomplish is writing an API that copies the leftmost 200 characters into field 1 and then entirety of the original field to field 2.

Normally I would do this as part of the SQL query, but since this is being triggered by an event I don’t have that option.

Hi Kevin,

Below is just an example for updating Service Order z_udf_string_1 = the leftmost 10 characters of descr and z_udf_string_2 = descr with Process Flow.

 

Sample of the input query:
select order_id,  SUBSTRING(descr, 0, 10) string_1,  descr from order_line WITH(NOLOCK) where order_type_id = 'service_order' and LEN(descr) > 10

 

Sample of the Update Action API:
<root xmlns:dt="urn:schemas-microsoft-com:datatypes">
  <session email="" alias="">
    <state bc_name="Service_Order">
      <action name="data">
        <main>
          <row number="1">
            <order_id dtype="string">{order_id}</order_id>
            <z_udf_string_1 dtype="string">{string_1}</z_udf_string_1>
            <z_udf_string_2 dtype="string">{descr}</z_udf_string_2>
          </row>
        </main>
      </action>
    </state>
  </session>
</root>


Hi Kevin,

Below is just an example for updating Service Order z_udf_string_1 = the leftmost 10 characters of descr and z_udf_string_2 = descr with Process Flow.

 

Sample of the input query:
select order_id,  SUBSTRING(descr, 0, 10) string_1,  descr from order_line WITH(NOLOCK) where order_type_id = 'service_order' and LEN(descr) > 10

 

Sample of the Update Action API:
<root xmlns:dt="urn:schemas-microsoft-com:datatypes">
  <session email="" alias="">
    <state bc_name="Service_Order">
      <action name="data">
        <main>
          <row number="1">
            <order_id dtype="string">{order_id}</order_id>
            <z_udf_string_1 dtype="string">{string_1}</z_udf_string_1>
            <z_udf_string_2 dtype="string">{descr}</z_udf_string_2>
          </row>
        </main>
      </action>
    </state>
  </session>
</root>

Thanks Josh, yeah unfortunately the issue here is that since it’s an event driven process flow (Rather than a periodic process flow that would be based on an underlying data query), I don’t have an input query. As far as I know this means I can only use the order elements as the inputs. Otherwise, as you pointed out, I could do this manipulation in the query as a separate variable.


In that case I think you need to request a customisation, i.e: adding computed column for that specific value.

I think in v15SP3 you can add computed column as expression using customizer


I have checked in the customizer for V15SP3 and yes, you can use expression.  

In earlier version of V15, I found you could just copy data from other column, but no expression was available.

 

 


Reply