I have an issue with using apex defined variable.
I call apex method to get data as a collection of Apex defined variables (let's call it 'Record' with recordID, recordName fields).
- data is retrieved correctly
- data is used in data table element in screen flow
- user can select multiple rows -> debug shows that selectedRows contains correct data
Transform element (same issue with assigning within a loop) is used to create text collection with selected recordIDs.
When creating Transform element I can map:
ScreenDataTable
/ selectedRows / recordID to collection of text variables.
save
no error
refresh page
error
- You can’t activate this automation until you resolve 2 errors.
- transform_element_label
- The flow metadata specifies the value “DataTable.selectedRows[$EachItem].recordId__NotFound” for elementReference, which isn’t available to the flow. Enter a valid resource.
- The element has an invalid reference to "DataTable.selectedRows[$EachItem].recordId__NotFound".
When I open transform element, mapping is displayed as
DataTable / selectedRows to collection of text variables
instead or original
DataTable / selectedRows / recordID to collection of text variables.
When I tried with loop+assignment, after refresh assignment showed recordId__NotFound with error.
When I retrieve flow's XML, I see that 'recordId__NotFound' is referenced.
Any idea?
Resolved.
Issue was similar to:
In my case, selectedRows from data table could not be used directly.
I created variable to store collection of selected apex-defined variables.
In data table's advanced settings I selected 'Manually assign variables (advanced)' and mapped selected rows to new variable.
That resolved the problem.