How to simulate calling two smart services in Appian ?

Hi Team,

I have a use case where if some user clicks on a link, then first, some data needs to be deleted and then second, an api integration needs to be triggered with a query parameter whose value basically is the value of the link clicked.(local!selectedSuiteName)

See below screenshot: 

So, if someone clicks on the first link, then first I need to delete the related data from db and secondly then I need to call an integration which is configured basically to call an API. But I want to pass the selected link value as a query parameter to the API, I am not sure how to do it in expression. What I know is I can call an integration using rule!<Integration name>, however I don't know how to pass the parameter which is basically saved in local!selectedSuiteName.

So the full flow is like,

1. When user clicks on a link, some related data need to be deleted from an appian table.

2. Now, I need to populate the same table with some data and that data basically I want to fetch from an integration which I have discussed above.

Below is the screenshot, How I am trying to achieve this.

Code:

a!localVariables(
  local!msg,
  a!cardLayout(
    contents: a!gridField(
      label: "Suites",
      labelPosition: "ABOVE",
      data: 'recordType!{cb3c545e-904d-4198-9ce7-1044eb68e4f6}BTUA_v2_GetAllSuites_RecordType',
      columns: {
        a!gridColumn(
          label: "Suite Name",
          sortField: 'recordType!{cb3c545e-904d-4198-9ce7-1044eb68e4f6}BTUA_v2_GetAllSuites_RecordType.fields.{50f36e4d-df17-4fd3-ad80-17401b261035}suitename',
          value: a!linkField(
            links: {
              a!dynamicLink(
                label: fv!row['recordType!{cb3c545e-904d-4198-9ce7-1044eb68e4f6}BTUA_v2_GetAllSuites_RecordType.fields.{50f36e4d-df17-4fd3-ad80-17401b261035}suitename'],
                saveInto: {
                  a!deleteFromDataStoreEntities(
                    dataToDelete: {
                      a!entityDataIdentifiers(
                        entity: cons!BTUA_v2_Script_tbl_constant,
                        identifiers: rule!BTUA_getListOfScriptIdentifiersForUser("abc@bc.cd"),
                        /*identifiers: rule!BTUA_getListOfScriptIdentifiersForUser(loggedInUser()),*/
                        
                      )
                    },
                    onSuccess: a!save(local!msg, "Success"),
                    onError: a!save(local!msg, "Failure")
                  ),
                  
                  a!writeToDataStoreEntity(
                    dataStoreEntity: cons!BTUA_v2_Script_tbl_constant,
                    valueToStore: rule!BTUA_v2_GetMappedScriptsForSelectedSuite(),
                    onSuccess: a!save(local!msg, "Success"),
                    onError: a!save(local!msg, "Failure")
                  ),
                  a!save(ri!isSuiteSelected, true()),
                  a!save(ri!isScriptSelected, false()),
                  a!save(
                    ri!selectedSuiteName,
                    fv!row['recordType!{cb3c545e-904d-4198-9ce7-1044eb68e4f6}BTUA_v2_GetAllSuites_RecordType.fields.{50f36e4d-df17-4fd3-ad80-17401b261035}suitename']
                  )
                }
              )
            }
          )
        )
      },
      validations: {},
      refreshAfter: "RECORD_ACTION",
      showSearchBox: true,
      showRefreshButton: false,
      actionsDisplay: "LABEL_AND_ICON"
    )
  ),
  
)

Line no. 32 basically calling an API integration for which I don't know how to pass query parameter which is basically local!selectedSuiteName.

Now here the main catch is that I can't call two smart services in a single expression. I want to simulate this somehow.

Could u guyz pls help me in this ?

Let me know if other data is required.

  Discussion posts and replies are publicly visible

Parents
  • 1. First thing is to define your integration with selectedSuiteName parameter as below-->

    2. Create a process variable and set it as required parameter in your processmodel as below 

    3. Call your integration from setup tab

    4. Go to data tab and you will your integration variable retrieves/auto-populated, update the value with pv!selectedSuiteName variable.

    5. Under outputs view, set your variables -->Enable activity- chaining

     

    6. Pass this as processparameter onto you interface a!startprocess link as others mentioned.

    Please let know if need more help further!!

Reply
  • 1. First thing is to define your integration with selectedSuiteName parameter as below-->

    2. Create a process variable and set it as required parameter in your processmodel as below 

    3. Call your integration from setup tab

    4. Go to data tab and you will your integration variable retrieves/auto-populated, update the value with pv!selectedSuiteName variable.

    5. Under outputs view, set your variables -->Enable activity- chaining

     

    6. Pass this as processparameter onto you interface a!startprocess link as others mentioned.

    Please let know if need more help further!!

Children