Hi All,
i am currently making a collection through clear collect. Below is the code. However, when i insert the collection into the gallery and when i try and select the column from collection, it throws an error saying required type is record.
How do i solve this?
Collect(
projectnames,
{
projectname: Distinct(
'F.P Details of Module',
'Project Name'
),
adjustedfp: Distinct(
'F.P Details of Module',
'Adjusted F.P'
),
unadjustedfp: Distinct(
'F.P Details of Module',
'Unadjusted F.P'
),
finalfp: Distinct(
'F.P Details of Module',
'Final F.P'
),
unqiueid: Distinct(
'F.P Details of Module',
'Unique ID'
)
}
)
Solved! Go to Solution.
Hi@Jayant2,
Based on the issue that you mentioned, do you want to create a collection based on the distinct project name?
Could you please share a bit more about the 'F.P Details of Module'?
From your description, I think you want to display the distinct result based on the project name, every section in the Gallery will display a distinct project name and each Label within will display the corresponding distinct other column values.
If my understanding is correct, I think you should directly use the GroupBy () rather than the Collect().
In my scenario, all the column type are Text type.
Set the Items property of the Gallery as below:
GroupBy('F.P Details of Module',"ProjectName","NameG")
Set Text property of the Label within as below:
ThisItem.ProjectName // for the distinct ProjectName
Concat(Distinct(ThisItem.NameG.'Adjusted F.P','Adjusted F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Unadjusted F.P','Unadjusted F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Final F.P','Final F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Unique ID','Unique ID'),Result,",")
Notice that every row represents the Text property of the Label corresponding to each column.
Regards,
Qi
@Anonymous
What is it that you are trying to achieve?
Each column in your collection is going to have a table with Result as its column.
Since you are using a Collection, this would be a table. If you are only using one record in your collection, I would consider using a variable instead.
Set(
projectnames,
{
projectname: Distinct('F.P Details of Module', 'Project Name'),
adjustedfp: Distinct('F.P Details of Module', 'Adjusted F.P'),
unadjustedfp: Distinct('F.P Details of Module', 'Unadjusted F.P'),
finalfp: Distinct('F.P Details of Module', 'Final F.P'),
unqiueid: Distinct('F.P Details of Module', 'Unique ID')
}
)
Then for your Gallery Items property:
projectNames.projectname
Will provide your gallery with a table of Result columns based on the Distinct.
Not sure if that is what you are trying to achieve, but based on the formula you provided, this should get you that.
I hope this is helpful for you.
@RandyHayes what I am trying to achieve is to create a collection of distinct project name along with other values that can be viewed inside of a gallery.
Project Name Final F.P unique id
ABCD 1.2 3456
XYZ 1.5 4544
From your approach of using a variable also produces table records and thus I am not able to use it in gallery.
Hi@Jayant2,
Based on the issue that you mentioned, do you want to create a collection based on the distinct project name?
Could you please share a bit more about the 'F.P Details of Module'?
From your description, I think you want to display the distinct result based on the project name, every section in the Gallery will display a distinct project name and each Label within will display the corresponding distinct other column values.
If my understanding is correct, I think you should directly use the GroupBy () rather than the Collect().
In my scenario, all the column type are Text type.
Set the Items property of the Gallery as below:
GroupBy('F.P Details of Module',"ProjectName","NameG")
Set Text property of the Label within as below:
ThisItem.ProjectName // for the distinct ProjectName
Concat(Distinct(ThisItem.NameG.'Adjusted F.P','Adjusted F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Unadjusted F.P','Unadjusted F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Final F.P','Final F.P'),Result,",")
Concat(Distinct(ThisItem.NameG.'Unique ID','Unique ID'),Result,",")
Notice that every row represents the Text property of the Label corresponding to each column.
Regards,
Qi
User | Count |
---|---|
252 | |
101 | |
94 | |
47 | |
38 |