<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to take specific field value from grid?</title><link>https://community.appian.com/discussions/f/data/12702/how-to-take-specific-field-value-from-grid</link><description>Hello All, 
 I have a requirement to fetch specific column data from grid and pass it to startProcess() function. Below is the scenario 
 Suppose my grid has below data 
 Field1 Field2 Field3 
 Task1 abc pqr 
 Task2 lmn stu 
 Task3 xyz mnp 
 
 This data</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to take specific field value from grid?</title><link>https://community.appian.com/thread/56881?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 20:04:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01bcaaef-7be2-428c-9e60-61a74c76f01b</guid><dc:creator>jonathan.guillen</dc:creator><description>&lt;p&gt;Hello Vivek,&lt;/p&gt;
&lt;p&gt;You can play with the following code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!animal_cdts: {
    {id: 1,description: &amp;quot;snake&amp;quot;},
    {id: 2,description: &amp;quot;lion&amp;quot;},
    {id: 3,description: &amp;quot;dog&amp;quot;},
    {id: 4,description: &amp;quot;cat&amp;quot;},
    {id: 5,description: &amp;quot;tiger&amp;quot;},
    {id: 6,description: &amp;quot;pig&amp;quot;}
  },
  local!selectedAnimal_int: null,
  local!selectedAnimal_cdt: null,
  local!animal_pagingInfo: a!gridSelection(
    pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: 5,
      sort: a!sortInfo(
        field: &amp;quot;id&amp;quot;,
        ascending: true
      )
    ),
    selected: null
  ),
  with(
    local!animal_datasubset: todatasubset(
      local!animal_cdts,
      local!animal_pagingInfo.pagingInfo
    ),
    local!animalCurrentPage_cdts: local!animal_datasubset.data,
    a!formLayout(
      contents: {
        a!textField(
          label: &amp;quot;TEST - SELECTED ANIMAL&amp;quot;,
          value: local!selectedAnimal_int,
          readOnly: true
        ),
        a!textField(
          label: &amp;quot;TEST - SELECTED ANIMAL OBEJCT&amp;quot;,
          value: local!selectedAnimal_cdt,
          readOnly: true
        ),
        a!gridField(
          totalCount: local!animal_datasubset.totalCount,
          selection: true,
          identifiers: property(local!animalCurrentPage_cdts,&amp;quot;id&amp;quot;,null),
          columns: {
            a!gridTextColumn(
              label: &amp;quot;id&amp;quot;,
              field: &amp;quot;id&amp;quot;,
              data: property(local!animalCurrentPage_cdts,&amp;quot;id&amp;quot;,null)
            ),
            a!gridTextColumn(
              label: &amp;quot;description&amp;quot;,
              field: &amp;quot;description&amp;quot;,
              data: property(local!animalCurrentPage_cdts,&amp;quot;description&amp;quot;,null)
            )
          },
          validations: if(
            count(local!animal_pagingInfo.selected) &amp;gt; 1,
            &amp;quot;You may only select one animal&amp;quot;,
            null
          ),
          value: local!animal_pagingInfo,
          saveInto: {
            local!animal_pagingInfo,
            if(
              count(local!animal_pagingInfo.selected) &amp;gt; 1,
              {},
              {
                a!save(
                  target: local!selectedAnimal_int,
                  value: save!value.selected
                ),
                a!save(
                  target: local!selectedAnimal_cdt,
                  value: index(
                    local!animalCurrentPage_cdts,
                    wherecontains(
                      tointeger(local!selectedAnimal_int),
                      tointeger(property(local!animalCurrentPage_cdts,&amp;quot;id&amp;quot;,null))
                    ),
                    null
                  )
                )
              }
            )
          }
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;On the above code, you will find the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;a selected animal id&amp;nbsp;&lt;/li&gt;
&lt;li&gt;a selected animal CDT.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can prepare your&amp;nbsp;process model to receive one of the above options.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;I will recommend sending only the Id&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Inside of your process model adds a new node to retrieve the rest of the information using a script task.&amp;nbsp; in this way, we are going to save some time processing the data.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to take specific field value from grid?</title><link>https://community.appian.com/thread/56825?ContentTypeID=1</link><pubDate>Tue, 19 Jun 2018 05:37:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:195f2c70-dd79-4644-ad44-4c3585d81066</guid><dc:creator>Abhay Giri</dc:creator><description>HI Vivek,&lt;br /&gt;
&lt;br /&gt;
You can achieve this by two ways:&lt;br /&gt;
&lt;br /&gt;
1) StartProcess takes parameters as dictionary so in your process model just add a new variableField2/TaskName and make it parameter type so whenever this process model start ,it can take the taskName as input parameter.Now pass the Field2 value when you call the StartProcess function like below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
a!startProcess{&lt;br /&gt;
&lt;br /&gt;
processParameters :{&lt;br /&gt;
Field1:&amp;quot;value&amp;quot;,&lt;br /&gt;
Field2/taskName:&amp;quot;Field2 value&amp;quot;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
2) In your process model, query the database to get Field2 value based on taskid and use it in your notification email.&lt;br /&gt;
&lt;br /&gt;
Regards&lt;br /&gt;
Abhay&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to take specific field value from grid?</title><link>https://community.appian.com/thread/56805?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 16:29:36 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e40cd595-8be9-450d-a024-34ce0c3d1f3a</guid><dc:creator>robertp</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt; &lt;br /&gt; From what I understand of your issue &amp;ndash; you&amp;rsquo;re having difficulty passing in data from a specific row to a startProcess rule call.&lt;br /&gt; &lt;br /&gt; a!startProcess takes in a dictionary of inputs as parameters.&lt;br /&gt; From the documentation &amp;ndash; &amp;ldquo;processParameters (Dictionary): A dictionary containing the parameters for the process and their values.&amp;rdquo;&lt;br /&gt; &lt;br /&gt; You can pass in the data into your start process call like the following:&lt;br /&gt; &lt;br /&gt; a!startProcess(&lt;br /&gt; &amp;hellip;&lt;br /&gt; processParameters:{&lt;br /&gt; taskId:Task2, /*Field1 value*/&lt;br /&gt; taskName:lmn /*Field2 value*/&lt;br /&gt; },&lt;br /&gt; &amp;hellip;&lt;br /&gt; )&lt;br /&gt; &lt;br /&gt; Another option would to be querying on the report from the task ID from inside the process model. &lt;br /&gt; &lt;br /&gt; I hope this helps!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to take specific field value from grid?</title><link>https://community.appian.com/thread/56804?ContentTypeID=1</link><pubDate>Mon, 18 Jun 2018 15:37:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:979e6bbb-0a4d-4664-8478-62fd9f7bd7f6</guid><dc:creator>Rahul Gundu</dc:creator><description>Hi Vivek&lt;br /&gt;
Attaching sample logic. Please go through it.  &lt;br /&gt;
with(&lt;br /&gt;
  local!items: {&lt;br /&gt;
    {&lt;br /&gt;
      id: 123,&lt;br /&gt;
      name: &amp;quot;Appian&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      id: 234,&lt;br /&gt;
      name: &amp;quot;MySql&amp;quot;&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
      id: 345,&lt;br /&gt;
      name: &amp;quot;Java&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
  },&lt;br /&gt;
  local!selectedItem: 123,&lt;br /&gt;
  local!itemPosition: wherecontains(&lt;br /&gt;
    tointeger(&lt;br /&gt;
      local!selectedItem&lt;br /&gt;
    ),&lt;br /&gt;
    tointeger(&lt;br /&gt;
      index(&lt;br /&gt;
        local!items,&lt;br /&gt;
        &amp;quot;id&amp;quot;,&lt;br /&gt;
        null&lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  if(&lt;br /&gt;
    rule!APN_isEmpty(&lt;br /&gt;
      local!itemPosition&lt;br /&gt;
    ),&lt;br /&gt;
    null,&lt;br /&gt;
    index(&lt;br /&gt;
      local!items,&lt;br /&gt;
      local!itemPosition,&lt;br /&gt;
      null&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>