113
Views
4
Comments
group rows into comma separated string and use it in dropdown tags
Application Type
Reactive

Hi All,

Below is the ProjectList_ProjectUser entity. This entity explains which User has access to which ImpactedSystem. I'm trying to group the ImpactedSystem into a comma separated values and use it in Dropdown tags for Edit Form.

I need to group the above entity and get ImpactedSystem in comma separated strings. Like this (alphabetic order in ImpactedSystem)I,  then, want to use the comma separated string in dropdown tags for Edit Form (this would be a user management page).

I have used MasterDetail widget for this, and current UI looks like below. (notice the ImpactedSystem is a normal input - after grouping it as comma separated string I'd like to use it in dropdown tags)

PS : if you know how to show a list into a dropdown tag, plz suggest or I'll try to raise a separate question for this.


Thanks & Regards,

Aman Devrath

2020-11-25 10-45-32
Mostafa Othman
Champion

Hello Aman,

If you will work with master details you can send employee Id or name to you aggregate and select all records for this user and you can use string_join action from text extension and pass ImpactedSystems list to it and separator ","

UserImage.jpg
vikas sharma
Champion

Hi,

For showing comma separated values you can need to use SQL query and in that can use STUFF() keyword to show the values comma separated.

Please refer : https://stackoverflow.com/questions/21760969/multiple-rows-to-one-comma-separated-value-in-sql-server

regards

2024-04-15 16-08-47
Aman Devrath

Hi,

I've used the STUFF() keyword and got some result, but it is appending all ImpactedSystem to every SGID.

SQL :


SELECT {ProjectPerUser}.[User], {ProjectPerUser}.[SGID], STUFF

(

    (

        SELECT ', ' + {ProjectList}.[Impactedsystem]

        FROM {ProjectList}

        Inner Join {ProjectListProjectPerUser} on {ProjectListProjectPerUser}.[ProjectListId] = {ProjectList}.[Id]

        Inner Join {ProjectPerUser} ON {ProjectPerUser}.[Id] = {ProjectListProjectPerUser}.[ProjectPerUserId]

        FOR XML PATH('')

    ), 1, 2, ''

) as ImpactedSystem

From {ProjectPerUser}

inner join {ProjectListProjectPerUser} on {ProjectListProjectPerUser}.[ProjectPerUserId] = {ProjectPerUser}.[Id]

Output of SQL:


Thanks,

Aman

2020-08-31 05-04-40
Rahul Jain

Hello Aman ,

If you want to manipulate data in client side so you can create data on after fetch of master data.

Please refer below demo url and oml .

Thanks

--RJ--

GroupBy.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.