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
docs.appian.com/.../Call_an_Integration.html
Hey Stefan, I did not get my answer in the documentation.
My question is rather simple now,
See the below Process Model
Now see the call integration screenshot below,
You can see that, there is a query parameter called name, in this API integration. Now my question is, how to configure this query parameter in the Call Integration Smart Service ?
See screenshot below where you can see, what I have done ?
Could u pls help here ?
Hi, You can create a rule input into Integration and map that rule input for the particular query Parameter by using the expression Editor, and while calling the integration into Process Model pass the value to that rule input.
Can u pls share the expression rule example ? It will be very helpful to me.
Expression Rule example?
I mean the expression for mapping the same ?
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!!
Hey, thanks for this detailed answer,
Could you pls help in verifying the way by which I am passing the parameters in the process.
I am trying to pass the parameters in the following integration
I have created a process variable for the above process which can be seen below-
Let me know if I am doing things correctly or not ?
Thanks in Advance.
In your code snippet, you try to call two smart service functions. This will not work as explained in your other thread.
Second, your process variable needs to configured as a parameter to be able to accept values when started.
Next, processParameters is a dictionary. In your case it should look like this
{ selectedSuiteName: local!selectedSuiteName }
Most of this already has been explained in your other thread.
And, all of this is covered in the Appian Academy trainings and tutorials.
yup totally agreed!