I have a parent Interface calling 2 child interfaces. Both the child interfaces are grids. The first grid shows previously added data and has capability to select a row and add it to the bottom grid using Select button. The second grid has search fields to search for an item and add it to the grid.
I'm passing these 2 different data as 2 different variables to the Grid 2. (Though I tried passing as single didn't work).
Here is my scenario:
Problem: This time when I select my second item from Grid 1, I don't see the newly added item in Grid 2. I see the newly added item is seen in local!submissionSubstance_HTTP but not in the Gri 2
This is the local for my Grid 1 selection local!submissionSubstance_HTTP: a!refreshVariable( value:rule!DCC_castSubmissionSubstanceData( submissionSubstance: local!selectedSubstance_HTTP, submissionNumber_text: ri!submissionNumber_text, submissionType_text: ri!submissionType_text, documentId_int: ri!documentInfo_Map.id, folderId_int: ri!documentInfo_Map.folderId, indexingType_text:ri!indexingType_text ), refreshOnVarChange: local!selectedSubstance_HTTP ),
This is the code for overall data seen in grid local!indexSubstances: a!refreshVariable( value:if( and( rule!FARM_isNullOrEmpty(ri!substanceAdded_cdt),/*ri! for items added via Add Substance button*/ rule!FARM_isNullOrEmpty(ri!selectedSubstance_HTTP) /*ri!for items via Grid 1 */ ), {}, if( rule!FARM_isNullOrEmpty(ri!substanceAdded_cdt), ri!selectedSubstance_HTTP, if( rule!FARM_isNullOrEmpty(ri!selectedSubstance_HTTP), ri!substanceAdded_cdt, union(ri!substanceAdded_cdt,ri!selectedSubstance_HTTP) ) ) ), refreshOnVarChange: ri!selectedSubstance_HTTP ), /*Initial data for grid*/ local!data1: if( rule!FARM_isNullOrEmpty(ri!documentId_int), local!submissionSubstances, local!documentSubstances ), /*Final Data to display - both Submission & Document substances*/ local!data: a!refreshVariable( value: if( and( rule!FARM_isNullOrEmpty(local!data1), rule!FARM_isNullOrEmpty( local!indexSubstances) ), {}, if( rule!FARM_isNullOrEmpty(local!data1), local!indexSubstances, if( rule!FARM_isNullOrEmpty(local!indexSubstances), local!data1, union(local!data1, local!indexSubstances) ) ) ), refreshOnReferencedVarChange: not(local!refresh) ),
Any help is highly appreciated.
Discussion posts and replies are publicly visible
Does your expression "DCC_castSubmissionSubstanceData" use local variables? If yes, you need to use a!refreshVariable with refreshAlways set to true.
That's a tricky behaviour of nested expressions calls.
Expression uses ri! value which is coming from Grid 1. Can you please help where do I need to specify a!refreshVariable? Grid 1 code is attached in below response
You don't. I just wanted to make sure that the issue is not coming from one of the nested expressions.
I wrote a blogpost about data flow in interfaces a while ago. That might help you.
https://appian.rocks/2022/07/05/data-in-interfaces/
In general, I suggest to invest some research time in a much more simplified version of what you want to do. Once working and fully understood, go back to solving your issue.