Hi All,
I have created a basic calculator and I found that my integration is working fine on the click of a button when it is tested on the interface.. I am using the same interface on site as well as portal object for the same application. But, the potal is giving me the following error:
I tried to find the answers in the community but I am not able to find the right answer to solve this scenario.My service account is having proper access to each and everything in this interface which is used in the portal , but still I am facing this issue in the save into parameter of the button, the integration is not working in the portal.
Discussion posts and replies are publicly visible
That information you provide is not much and really hard to say anything. Can you share a bit more?
I have used an Open AI plugin which provides a connected system, using that connected system I have created chat gpt 3 integration with post method to query the chat gpt 3, basically it is an integration of Chat GPT. I have created a simple interface with all local variables, using this page, I have input date field and a calculate button. In the calculate button, I am trying to pass the local!date at runtime(on the click of calculate button) and trying to call the integration(the chat gpt integration) which is returning the age value based on the input date.I have thoroughly tested the interface and also created the site. But, when I am calling the same interface in the portal, it is giving me the above stated error, & I am not able to call the inegration in the saveinto parameter of my calculate button (in the case of portals). Only portal is giving me an issue, rest everywhere it is working fine.I also checked the service account permissions for all the dependent objects referred in the interface/portal. but still I cannot identify what is the exact issue.
Can you post the contents of the expression throwing the error?
Plugins do not work on portals.
To be able to call the Open AI API, you would have to create an API in Appian. That API then calls the OpenAI API. Then call this API from the portal.
This is my Integration object.Below is the interface which I have used to call this integration, and this interface is later used in the portal. Which is giving me http 500 error stated on the top of the discussion.
a!localVariables( local!date, local!calculate, local!anotherAge, local!apiResult:a!refreshVariable( value: if(a!isNullOrEmpty(local!calculate),{},index(index(index(index(rule!GC_AgeCalculator(dateofbirth: local!date),"result",{}),"choices",{}),1,{}),"text",{})), refreshOnReferencedVarChange: local!date, refreshOnVarChange: local!anotherAge ), local!response:a!refreshVariable( value: local!apiResult, refreshOnVarChange: local!apiResult ), { a!sectionLayout( showWhen: a!isNullOrEmpty(local!response), label: "", contents: { a!columnsLayout( columns: { a!columnLayout( contents: {} ), a!columnLayout( contents: { a!cardLayout( contents: { a!imageField( labelPosition: "COLLAPSED", images: { a!documentImage( document: cons!GC_AGECALCULATOR_1 ) }, size: "LARGE", style: "AVATAR", align: "CENTER" ), a!richTextDisplayField( showWhen: a!isNullOrEmpty(local!response), labelPosition: "COLLAPSED", value: { char(10), char(10), a!richTextItem( text: upper("Age Calculator"), color: "ACCENT", size: "LARGE", style: "STRONG" ), char(10), char(10), a!richTextItem( text: "Calculate your exact age in just 1 click", size: "MEDIUM" ), char(10), char(10) }, align: "CENTER" ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!dateField( label: "", labelPosition: "ABOVE", value: local!date, saveInto: local!date, validations: {} ) ), a!sideBySideItem( item: a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Calculate", icon: "angle-double-right", value: true, saveInto: { local!calculate, a!save(local!response,local!apiResult) }, size: "STANDARD", width: "FILL", style: "LINK", disabled: a!isNullOrEmpty(local!date), loadingIndicator: true ) }, align: "START" ) ) } ) }, tooltip: "Calculate your age using this Age Calculator", height: "AUTO", style: "CHARCOAL_SCHEME", shape: "ROUNDED", marginBelow: "STANDARD", showBorder: true, showShadow: true ) } ), a!columnLayout( contents: {} ) } ) } ), a!sectionLayout( showWhen: a!isNotNullOrEmpty(local!response), label: "", contents: { a!columnsLayout( columns: { a!columnLayout( contents: {} ), a!columnLayout( contents: { a!cardLayout( contents: { a!imageField( labelPosition: "COLLAPSED", images: { a!documentImage( document: cons!GC_AGECALCULATOR_1 ) }, size: "LARGE", style: "AVATAR", align: "CENTER" ), a!richTextDisplayField( labelPosition: "COLLAPSED", value: { a!richTextItem( text: local!response, color: "POSITIVE", size: "LARGE", style: "STRONG" ), char(10), char(10), }, align: "CENTER" ), a!sideBySideLayout( items: { a!sideBySideItem( item: a!buttonArrayLayout( buttons: { a!buttonWidget( label: "Calculate Another Age", icon: "angle-double-right", value: true, saveInto: { local!anotherAge, a!save(local!date,null), a!save(local!response,null), a!save(local!calculate,null), a!save(local!apiResult,null), }, size: "STANDARD", width: "FILL", style: "LINK", loadingIndicator: true ) }, align: "START" ) ) } ) }, tooltip: "Calculate your age using this Age Calculator", height: "AUTO", style: "CHARCOAL_SCHEME", shape: "ROUNDED", marginBelow: "STANDARD", showBorder: true, showShadow: true ) } ), a!columnLayout( contents: {} ) } ) } ) } )
This is the output of the interface:
Hi Stefan, in order to call the Open AI API inside and API, which type of web API would you suggest?
Let me ask a question first. Why are you using the plugin? Calling the Open AI API is so simple using just a normal HTTP API.
I would create a POST API and transport the data as JSON in the body.
Yes I agree, I would be using the HTTP API as well, but I was testing this Integration call on portals and was checking its scope.
I have a similar use case. I am using http connected sytem to connect to AWS gateway and used it in the integration to call a service. Now when I use this integration in a portal page interface, it doen't work and gives the below error: "Connected system not found"
How do I resolve this?
I need more info.