I have a data reference property configured as search and select in a view and below the property, I have called the same data reference property for read only. So if the user search a value and select it , the selected value will be populated in the below read only data reference table.
If the user search and add 5 records and if he wants to delete a particular record , he have to search again in the component and uncheck it . There is no option to delete it directly from read only table below. And the search and select component also does not show all the selected records.
Is there any way , we can configure a delete button on the read only table or to make the search and select to display all the selected records.
@GokulS55 welcome to the community! Curious on the configuration here, why show the same data twice on the screen? I’ve seen whispers of this in various discussions, which is curious as my experience with Pega has never been to show the same data twice in the same form (it creates all kinds of UX issues, data in memory, conflicting actions etc.).
I assume you are showing it again, so you can confirm back to the user what they have selected (if there were multiple searches and selecting)?
Hi @MarcCheong , Yes, we have given the read only below table, so the user can see the selected records in the same screen. The issue we are facing is, if the user wants to unselect or remove one record, he has to search and uncheck it again.
@GokulS55 the problem is, once you make the second table “not read only” then you have the issues I mention. Even if you could hack a delete icon on, you’d then have synch issues. By way of example I configured a Search and Select and Combobox on the same data reference and you can see things start to unravel.
Some suggested solutions:
Review step. If you create a mutli-step form (screenflow), the first step you select and second step you review. This would allow you to review the items selected and modify. I have successfully used this approach at many clients, both in UI Kit and Constellation when there is a need to edit / review.
Build a DX Component that allows Search, Select and Review. I get the feeling the current Search and Select was designed for a single action of searching and selecting - when you start adding more and more iterations, that is when you need the addition review you mention.
Adding to what @MarcCheong has showcased, you can have an embedded table to start with by setting up the Add button to open modal window with Action type (v25). In the modal window, you can have the search and select where you can have single/multiple entries selected and when they click submit, you can populate the selected entries into the embedded list. You will have an option to delete the entries on the embedded table before you submit the screen or add new ones as well.
Hope this helps to have one more approach to help your thinking
Issue 1: I have added two rows in the table and the case forwards for approval. If the case gets rejected and comes back to the user, where the user logs in again and tried to click edit from the three dot menu. Inside the popup, the search and selected value didn’t persist. If he again search with the same value inside that same popup, it displays the result with the selected option.
Issue 2: I have added a new record in the table and deleted that record with the three dot menu option. Post that, if I try to Add a new record again, it shows the search field value of the old deleted value in that new search criteria and the result get populated. Its basically , how much rows with values , I have deleted , if I add those rows again, it shows the old values.
You have to setup separate views for Create and Edit actions.
For Create, you have to setup a view where you can configure the search and select for setting up new records and adding to embedded list.
For Edit option, as you already have the pyGUID of the record, you can show the view which has all the fields for your object in editable mode.
Whenever you open the create view, in the pre processing activity/DT you have to clean up the data reference field which you have used for the search and select. Also ensure that, before adding records to embedded list on the post processing, ensure that the pyGUID is not present in the embedded list. Basically you have to ensure that the data records you select have to be uniquely populated in the embedded list.
Once you do this, delete action will also work fine.
I’m also not sure if the Search and Select was designed to be used in a modal inside embedded data. The component itself doesn’t persist things like the searched criteria, its all in memory. On submitting, I’d want to make sure the embedded table is using modals as an ACTION not as a VIEW, again to ensure values are persisted - I’m not sure @JayachandraSiddipeta that we 100% need post-processing to do that? It should happen naturally? But again, Search and Select inside a Table Modal is a new concept for me - I have not seen it implemented that way.
The above mentioned approach is possible. Please find below a working version of the idea mentioned by me.
For both the create and edit actions, i have used different flow actions and views.
Ofcourse you have to make some changes to do some data copying and duplicate checks based on your unique id for the record. But that’s some basic pega skills of writing data transforms. Extended the pyRefreshData as well on the work layer as well copying data from embedded data reference page to work page’s embedded list.